/* 中国风格样式 */
:root {
    --primary-red: #c8102e;
    --gold: #d4af37;
    --ink-black: #1a1a1a;
    --paper-white: #faf8f3;
    --jade-green: #00a693;
    --cloud-gray: #e8e4dc;
    --border-color: #d4af37;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Serif SC', serif;
    background: linear-gradient(135deg, #faf8f3 0%, #e8e4dc 100%);
    color: var(--ink-black);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* 背景装饰 - 祥云 */
.bg-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.cloud {
    position: absolute;
    width: 200px;
    height: 80px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 80"><path d="M40,60 Q20,60 20,40 Q20,20 40,20 Q50,10 70,20 Q90,10 110,20 Q130,20 130,40 Q130,60 110,60 Z" fill="%23d4af37" opacity="0.1"/></svg>') no-repeat center;
    background-size: contain;
    animation: float 20s infinite ease-in-out;
}

.cloud-1 {
    top: 10%;
    left: -10%;
    animation-delay: 0s;
}

.cloud-2 {
    top: 50%;
    right: -10%;
    animation-delay: 7s;
}

.cloud-3 {
    bottom: 20%;
    left: 20%;
    animation-delay: 14s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(30px, -20px) rotate(2deg);
    }
    50% {
        transform: translate(0, -40px) rotate(-2deg);
    }
    75% {
        transform: translate(-30px, -20px) rotate(2deg);
    }
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
    z-index: 1;
}

/* 主卡片 */
.main-card {
    background: linear-gradient(135deg, var(--primary-red) 0%, #a00c24 100%);
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 60px rgba(200, 16, 46, 0.3);
    margin-bottom: 30px;
    overflow: hidden;
}

.main-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(255, 255, 255, 0.03) 10px,
        rgba(255, 255, 255, 0.03) 20px
    );
    animation: shimmer 20s linear infinite;
}

@keyframes shimmer {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.seal-decoration {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: var(--gold);
    border-radius: 50%;
    opacity: 0.3;
    border: 3px solid rgba(255, 255, 255, 0.5);
}

.seal-decoration::after {
    content: '福';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
    font-weight: bold;
    color: var(--primary-red);
}

.avatar-wrapper {
    position: relative;
    z-index: 1;
    margin-bottom: 20px;
}

.avatar-frame {
    width: 120px;
    height: 120px;
    margin: 0 auto;
    position: relative;
    padding: 8px;
    background: linear-gradient(135deg, var(--gold) 0%, #f4d03f 100%);
    border-radius: 50%;
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.4);
}

.avatar-frame::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border: 2px solid var(--gold);
    border-radius: 50%;
    opacity: 0.5;
}

.avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--paper-white);
}

.title {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 42px;
    color: var(--gold);
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

.description {
    color: var(--paper-white);
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 30px;
    opacity: 0.95;
    position: relative;
    z-index: 1;
}

.stats-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    position: relative;
    z-index: 1;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-label {
    color: var(--paper-white);
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 8px;
}

.stat-value {
    color: var(--gold);
    font-size: 28px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.divider {
    width: 2px;
    height: 50px;
    background: linear-gradient(to bottom, transparent, var(--gold), transparent);
}

/* 卡片 */
.card {
    background: var(--paper-white);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 2px solid var(--border-color);
    position: relative;
}

.card::before,
.card::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid var(--gold);
}

.card::before {
    top: -2px;
    left: -2px;
    border-right: none;
    border-bottom: none;
}

.card::after {
    bottom: -2px;
    right: -2px;
    border-left: none;
    border-top: none;
}

.section-title {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 24px;
    color: var(--primary-red);
    text-align: center;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.title-decoration {
    color: var(--gold);
    font-size: 18px;
}

/* 金额按钮 */
.amount-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.amount-btn {
    background: linear-gradient(135deg, var(--paper-white) 0%, var(--cloud-gray) 100%);
    border: 2px solid var(--gold);
    border-radius: 12px;
    padding: 20px;
    font-size: 20px;
    font-weight: bold;
    color: var(--primary-red);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.amount-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.3), transparent);
    transition: left 0.5s ease;
}

.amount-btn:hover::before {
    left: 100%;
}

.amount-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.4);
    border-color: var(--primary-red);
}

.amount-btn.selected {
    background: linear-gradient(135deg, var(--primary-red) 0%, #a00c24 100%);
    color: var(--gold);
    border-color: var(--gold);
    box-shadow: 0 8px 20px rgba(200, 16, 46, 0.4);
}

.amount-text {
    position: relative;
    z-index: 1;
}

/* 编辑框统一样式 - 中国风格 */
.input-field {
    width: 100%;
    padding: 16px 24px;
    border: none;
    border-radius: 0;
    font-size: 16px;
    font-family: 'Noto Serif SC', serif;
    background: linear-gradient(to bottom, #fdfcf8, #f8f5ed);
    color: var(--ink-black);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow:
        inset 0 2px 8px rgba(0, 0, 0, 0.04),
        0 1px 0 rgba(255, 255, 255, 0.8);
    /* 中国风边框效果 - 双线框 */
    outline: 2px solid var(--gold);
    outline-offset: -2px;
    margin-top: 12px;
}

.input-field::placeholder {
    color: #a09080;
    font-style: italic;
    opacity: 0.8;
}

/* 输入框容器装饰 */
.input-wrapper {
    position: relative;
    margin-bottom: 16px;
}

.input-wrapper::before,
.input-wrapper::after {
    content: '◆';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gold);
    font-size: 10px;
    opacity: 0;
    transition: all 0.3s ease;
}

.input-wrapper::before {
    left: -20px;
}

.input-wrapper::after {
    right: -20px;
}

.input-wrapper:focus-within::before,
.input-wrapper:focus-within::after {
    opacity: 1;
}

/* 聚焦状态 - 华丽的中国风效果 */
.input-field:focus {
    outline: 3px solid var(--primary-red);
    outline-offset: -3px;
    background: linear-gradient(to bottom, #ffffff, #fdfcf8);
    box-shadow:
        inset 0 2px 8px rgba(0, 0, 0, 0.02),
        0 0 0 6px rgba(200, 16, 46, 0.08),
        0 8px 24px rgba(200, 16, 46, 0.12);
    transform: translateY(-1px);
}

/* 悬停状态 */
.input-field:hover:not(:focus) {
    outline-color: var(--primary-red);
    background: linear-gradient(to bottom, #fefdfb, #faf8f0);
    box-shadow:
        inset 0 2px 8px rgba(0, 0, 0, 0.03),
        0 4px 12px rgba(212, 175, 55, 0.15);
}

/* 输入框角落装饰 */
.input-decorated {
    position: relative;
}

.input-decorated::before,
.input-decorated::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border: 2px solid var(--gold);
    pointer-events: none;
    transition: all 0.3s ease;
}

.input-decorated::before {
    top: -1px;
    left: -1px;
    border-right: none;
    border-bottom: none;
}

.input-decorated::after {
    bottom: -1px;
    right: -1px;
    border-left: none;
    border-top: none;
}

.input-decorated:focus-within::before,
.input-decorated:focus-within::after {
    border-color: var(--primary-red);
    width: 16px;
    height: 16px;
}

/* 文本域特殊样式 */
.textarea {
    min-height: 120px;
    resize: vertical;
    margin-top: 16px;
    line-height: 1.8;
    padding: 20px 24px;
}

.textarea:focus {
    min-height: 140px;
}

/* 数字输入框样式优化 */
input[type="number"].input-field {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.5px;
}

input[type="number"].input-field::-webkit-inner-spin-button,
input[type="number"].input-field::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"].input-field {
    -moz-appearance: textfield;
}

/* 密码输入框样式 */
input[type="password"].input-field {
    letter-spacing: 4px;
    font-size: 18px;
}

/* 输入框标签样式 */
.input-label {
    display: block;
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 16px;
    color: var(--primary-red);
    margin-bottom: 8px;
    padding-left: 4px;
}

/* 输入框组样式 - 用于登录等场景 */
.input-group {
    margin-bottom: 20px;
}

.input-group .input-field:first-child {
    margin-top: 0;
}

/* 错误状态 */
.input-field.error {
    outline-color: #d64545;
    background: linear-gradient(to bottom, #fff8f8, #fff0f0);
}

.input-field.error:focus {
    box-shadow:
        inset 0 2px 8px rgba(0, 0, 0, 0.02),
        0 0 0 6px rgba(214, 69, 69, 0.1),
        0 8px 24px rgba(214, 69, 69, 0.15);
}

/* 成功状态 */
.input-field.success {
    outline-color: var(--jade-green);
    background: linear-gradient(to bottom, #f8fffc, #f0fff8);
}

.input-field.success:focus {
    box-shadow:
        inset 0 2px 8px rgba(0, 0, 0, 0.02),
        0 0 0 6px rgba(0, 166, 147, 0.1),
        0 8px 24px rgba(0, 166, 147, 0.15);
}

/* 禁用状态 */
.input-field:disabled {
    background: var(--cloud-gray);
    outline-color: #ccc;
    color: #999;
    cursor: not-allowed;
}

/* 响应式适配 */
@media (max-width: 768px) {
    .input-field {
        padding: 14px 18px;
        font-size: 16px; /* 防止iOS缩放 */
    }

    .textarea {
        min-height: 100px;
        padding: 16px 18px;
    }
}

/* 支付按钮 */
.pay-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-red) 0%, #a00c24 100%);
    border: 3px solid var(--gold);
    border-radius: 16px;
    padding: 20px;
    font-size: 24px;
    font-weight: bold;
    color: var(--gold);
    cursor: pointer;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.pay-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.pay-btn:hover::before {
    width: 400px;
    height: 400px;
}

.pay-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(200, 16, 46, 0.5);
}

.pay-btn:active {
    transform: translateY(0);
}

.btn-text {
    position: relative;
    z-index: 1;
    font-family: 'Ma Shan Zheng', cursive;
}

.btn-decoration {
    width: 30px;
    height: 30px;
    border: 2px solid var(--gold);
    position: relative;
    z-index: 1;
}

.btn-decoration.left {
    border-right: none;
    border-bottom: none;
}

.btn-decoration.right {
    border-left: none;
    border-top: none;
}

/* 感谢墙 */
.donor-list {
    max-height: 500px;
    overflow-y: auto;
}

.donor-list::-webkit-scrollbar {
    width: 8px;
}

.donor-list::-webkit-scrollbar-track {
    background: var(--cloud-gray);
    border-radius: 4px;
}

.donor-list::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 4px;
}

.donor-item {
    background: linear-gradient(135deg, var(--paper-white) 0%, var(--cloud-gray) 100%);
    border-left: 4px solid var(--gold);
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.donor-item:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
}

.donor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.donor-name {
    font-weight: bold;
    color: var(--primary-red);
    font-size: 16px;
}

.donor-amount {
    color: var(--gold);
    font-weight: bold;
    font-size: 18px;
}

.donor-message {
    color: var(--ink-black);
    font-size: 14px;
    line-height: 1.6;
    opacity: 0.8;
    padding-left: 10px;
    border-left: 2px solid var(--cloud-gray);
}

.empty-tip {
    text-align: center;
    color: var(--ink-black);
    opacity: 0.5;
    padding: 40px 20px;
    font-size: 16px;
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 30px 0;
    color: var(--ink-black);
    opacity: 0.6;
    font-size: 14px;
}

/* 弹窗 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--paper-white);
    border: 3px solid var(--gold);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--cloud-gray);
    border-top-color: var(--primary-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.modal-content p {
    color: var(--ink-black);
    font-size: 18px;
    font-weight: bold;
}

/* 响应式 */
@media (max-width: 768px) {
    .container {
        padding: 20px 15px;
    }

    .main-card {
        padding: 30px 20px;
    }

    .title {
        font-size: 32px;
    }

    .amount-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-row {
        gap: 20px;
    }

    .stat-value {
        font-size: 24px;
    }
}

/* 管理后台样式 */
.admin-container {
    max-width: 1000px;
}

.login-card {
    max-width: 400px;
    margin: 100px auto;
}

.login-card .input-field {
    margin-top: 16px;
}

.login-card .input-field:first-of-type {
    margin-top: 0;
}

.login-btn {
    margin-top: 24px;
    margin-bottom: 0;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.logout-btn {
    padding: 10px 24px;
    background: linear-gradient(135deg, var(--paper-white) 0%, var(--cloud-gray) 100%);
    border: 2px solid var(--gold);
    border-radius: 10px;
    color: var(--primary-red);
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.4);
    border-color: var(--primary-red);
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    text-align: center;
    padding: 20px;
}

.stat-emoji {
    font-size: 2em;
    display: block;
    margin-bottom: 8px;
}

.table-wrapper {
    overflow-x: auto;
}

.order-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.order-table th,
.order-table td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid var(--cloud-gray);
}

.order-table th {
    background: linear-gradient(135deg, var(--paper-white) 0%, var(--cloud-gray) 100%);
    font-weight: 600;
    color: var(--primary-red);
}

.order-table tbody tr:hover {
    background: var(--cloud-gray);
}

.trade-no {
    font-family: monospace;
    font-size: 0.85em;
}

.message-cell {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
}

.status-badge.paid {
    background: #d4edda;
    color: #155724;
}

.status-badge.pending {
    background: #fff3cd;
    color: #856404;
}

.delete-btn {
    padding: 6px 12px;
    background: linear-gradient(135deg, var(--paper-white) 0%, var(--cloud-gray) 100%);
    border: 2px solid #d64545;
    border-radius: 8px;
    color: #d64545;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: bold;
    transition: all 0.3s ease;
}

.delete-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(214, 69, 69, 0.3);
    background: #ffe5e5;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
}

.pagination button {
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--paper-white) 0%, var(--cloud-gray) 100%);
    border: 2px solid var(--gold);
    border-radius: 10px;
    color: var(--primary-red);
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.pagination button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.4);
    border-color: var(--primary-red);
}

.pagination span {
    color: var(--ink-black);
    font-weight: bold;
}

/* Toast */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.98);
    background: var(--ink-black);
    color: var(--paper-white);
    padding: 15px 25px;
    border-radius: 12px;
    border: 2px solid var(--gold);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    font-size: 16px;
    text-align: center;
    max-width: 360px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

@media (max-width: 768px) {
    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}
