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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 900px;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    background: white;
    color: #666;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    background: #f5f7ff;
}

.tab-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.form-wrapper {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    padding: 40px;
}

/* ===== 微信用户信息展示 ===== */
.wechat-user-section {
    background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 24px;
    border: 1px solid #c8e6c9;
}

.wechat-user-inner {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wx-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid #66bb6a;
    flex-shrink: 0;
}

.wx-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.wx-nickname {
    font-size: 15px;
    font-weight: 700;
    color: #2e7d32;
}

.wx-label {
    font-size: 12px;
    color: #66bb6a;
}

.wechat-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    margin-bottom: 24px;
    background: #f5f7ff;
    border-radius: 10px;
    color: #667eea;
    font-size: 14px;
}

.wechat-loading-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #d0d6ff;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 24px;
    font-weight: 600;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
    font-size: 14px;
}

.required {
    color: #e74c3c;
}

.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    outline: none;
    background: #fafafa;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus {
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.radio-group {
    display: flex;
    gap: 20px;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 10px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s ease;
    flex: 1;
    justify-content: center;
}

.radio-label:hover {
    border-color: #667eea;
    background: #f5f7ff;
}

.radio-label input[type="radio"] {
    display: none;
}

.radio-label span {
    color: #555;
    font-size: 15px;
    transition: all 0.3s ease;
}

.radio-label input[type="radio"]:checked + span {
    color: #667eea;
    font-weight: 600;
}

.radio-label input[type="radio"]:checked {
    border-color: #667eea;
}

.radio-label input[type="radio"]:checked + span::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #667eea;
    margin-right: 8px;
}

.radio-label span::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #ccc;
    margin-right: 8px;
    transition: all 0.3s ease;
}

.radio-label input[type="radio"]:checked + span::before {
    background: #667eea;
    border-color: #667eea;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.form-actions button {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

#submitBtn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

#submitBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

#submitBtn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#resetBtn {
    background: #f0f0f0;
    color: #666;
}

#resetBtn:hover {
    background: #e0e0e0;
}

.result {
    margin-top: 20px;
    padding: 16px;
    border-radius: 8px;
    font-size: 14px;
    display: none;
}

.result.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.result.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-box input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}

.search-box input:focus {
    border-color: #667eea;
}

.search-box button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

#searchBtn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

#refreshBtn {
    background: #f0f0f0;
    color: #666;
}

.loading-text {
    text-align: center;
    color: #667eea;
    padding: 20px;
}

#recordsError {
    margin-bottom: 20px;
}

/* ===== 卡片式记录列表 ===== */
.records-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.record-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #e8e8e8;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: all 0.25s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.record-card:hover {
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.12);
    transform: translateY(-2px);
    border-color: #d0d6ff;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px 12px;
    border-bottom: 1px solid #f0f0f0;
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f3ff 100%);
}

.card-applicant {
    font-size: 17px;
    font-weight: 700;
    color: #2c3e50;
}

.card-applicant-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #e0e0e0;
    flex-shrink: 0;
    object-fit: cover;
}

.card-avatar-default {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card-body {
    padding: 14px 18px;
    flex: 1;
}

.card-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 7px 0;
    border-bottom: 1px dashed #f0f0f0;
    gap: 10px;
}

.card-row:last-child {
    border-bottom: none;
}

.card-label {
    font-size: 13px;
    color: #888;
    flex-shrink: 0;
    min-width: 64px;
}

.card-value {
    font-size: 14px;
    color: #444;
    text-align: right;
    word-break: break-all;
    flex: 1;
}

.card-footer {
    padding: 12px 18px;
    border-top: 1px solid #f0f0f0;
    text-align: right;
    background: #fafbfc;
}

.card-edit-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

.card-edit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.card-no-action {
    font-size: 13px;
    color: #bbb;
}

/* ===== 记录高亮闪烁动画（从通知跳转） ===== */
@keyframes highlightPulse {
    0%   { box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.6); }
    50%  { box-shadow: 0 0 0 8px rgba(102, 126, 234, 0); }
    100% { box-shadow: 0 0 0 0 rgba(102, 126, 234, 0); }
}
.highlight-flash {
    animation: highlightPulse 0.8s ease-in-out 3;
    border-color: #667eea !important;
    background: #f0f3ff !important;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

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

.status-running {
    background: #cce5ff;
    color: #004085;
}

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

.status-rejected {
    background: #f8d7da;
    color: #721c24;
}

.status-returned {
    background: #ffeeba;
    color: #856404;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.pagination button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    background: #f0f0f0;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination button:hover:not(:disabled) {
    background: #667eea;
    color: white;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination span {
    font-size: 14px;
    color: #666;
}



#cancelEditBtn {
    background: #95a5a6;
    color: white;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

#cancelEditBtn:hover {
    background: #7f8c8d;
}

/* ===== 自定义弹窗 ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-box {
    background: white;
    border-radius: 16px;
    padding: 36px 32px 28px;
    min-width: 360px;
    max-width: 460px;
    width: 90%;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.2);
    transform: scale(0.85) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: center;
}

.modal-overlay.active .modal-box {
    transform: scale(1) translateY(0);
}

.modal-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

.modal-icon.confirm {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.modal-icon.success {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.modal-icon.error {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.modal-icon.loading-icon {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.modal-icon.loading-icon .modal-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 10px;
}

.modal-body {
    font-size: 15px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 28px;
}

.modal-body .hint-box {
    margin-top: 14px;
    padding: 12px 14px;
    background: #fff8e1;
    border-radius: 8px;
    border-left: 4px solid #ffc107;
    text-align: left;
    font-size: 14px;
    color: #856404;
}

.modal-body .hint-box strong {
    color: #e65100;
}

.modal-body .link-row {
    margin-top: 12px;
}

.modal-body .link-row a {
    color: #667eea;
    text-decoration: underline;
    font-weight: 600;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.modal-actions button {
    padding: 12px 32px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    min-width: 100px;
}

.modal-actions .btn-confirm {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.modal-actions .btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.35);
}

.modal-actions .btn-cancel {
    background: #f0f0f0;
    color: #666;
}

.modal-actions .btn-cancel:hover {
    background: #e0e0e0;
}

.modal-actions .btn-ok {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.modal-actions .btn-ok:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(40, 167, 69, 0.35);
}

.modal-actions .btn-error-ok {
    background: #f0f0f0;
    color: #555;
}

.modal-actions .btn-error-ok:hover {
    background: #e0e0e0;
}

/* ===== 移动端响应式 ===== */
@media (max-width: 768px) {
    body {
        padding: 12px;
        align-items: flex-start;
        min-height: 100vh;
    }

    .container {
        max-width: 100%;
    }

    .tabs {
        gap: 8px;
        margin-bottom: 15px;
    }

    .tab-btn {
        padding: 10px 20px;
        font-size: 14px;
        flex: 1;
        text-align: center;
    }

    .form-wrapper {
        padding: 24px 16px;
        border-radius: 12px;
    }

    h1 {
        font-size: 20px;
        margin-bottom: 20px;
    }

    .form-group {
        margin-bottom: 20px;
    }

    .form-group label {
        font-size: 14px;
        margin-bottom: 6px;
    }

    .form-group input[type="text"],
    .form-group textarea {
        padding: 12px;
        font-size: 14px;
        border-radius: 8px;
    }

    .form-group textarea {
        min-height: 80px;
    }

    .radio-group {
        flex-direction: column;
        gap: 10px;
    }

    .radio-label {
        padding: 12px 16px;
        font-size: 14px;
    }

    .form-actions {
        flex-direction: column;
        gap: 10px;
        margin-top: 24px;
    }

    .form-actions button {
        padding: 14px;
        font-size: 15px;
    }

    .search-box {
        flex-direction: column;
        gap: 10px;
    }

    .search-box input {
        padding: 12px;
        font-size: 14px;
    }

    .search-box button {
        padding: 12px;
        font-size: 14px;
    }

    .records-list {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .record-card {
        border-radius: 10px;
    }

    .card-header {
        padding: 14px 14px 10px;
    }

    .card-applicant {
        font-size: 16px;
    }

    .card-body {
        padding: 12px 14px;
    }

    .card-row {
        padding: 6px 0;
    }

    .card-label {
        font-size: 12px;
        min-width: 60px;
    }

    .card-value {
        font-size: 13px;
    }

    .card-footer {
        padding: 10px 14px;
    }

    .card-edit-btn {
        padding: 7px 16px;
        font-size: 12px;
    }

    .status-badge {
        padding: 3px 8px;
        font-size: 11px;
    }

    .pagination {
        gap: 10px;
    }

    .pagination button {
        padding: 8px 16px;
        font-size: 13px;
    }

    .modal-box {
        min-width: 90%;
        max-width: 92%;
        padding: 28px 20px 22px;
    }

    .modal-icon {
        width: 56px;
        height: 56px;
        font-size: 28px;
        margin-bottom: 16px;
    }

    .modal-title {
        font-size: 18px;
    }

    .modal-body {
        font-size: 14px;
        margin-bottom: 22px;
    }

    .modal-actions button {
        padding: 10px 24px;
        font-size: 14px;
        min-width: 80px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 8px;
    }

    .form-wrapper {
        padding: 20px 12px;
    }

    h1 {
        font-size: 18px;
        margin-bottom: 18px;
    }

    .form-actions button {
        padding: 12px;
        font-size: 14px;
    }

    .modal-box {
        padding: 24px 16px 20px;
    }

    .modal-icon {
        width: 48px;
        height: 48px;
        font-size: 24px;
        margin-bottom: 14px;
    }

    .modal-title {
        font-size: 16px;
    }

    .modal-body {
        font-size: 13px;
        margin-bottom: 20px;
    }
}
