/* ============================================
   简历工坊 - 前台样式 (黑白简约风格)
   Resume Builder - Frontend Styles
   ============================================ */

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    color: #333; background: #fff; line-height: 1.6;
}
a { color: #000; text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* Typography */
h1, h2, h3, h4 { font-weight: 600; color: #000; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.125rem; }
p { margin-bottom: 0.5rem; }
.text-muted { color: #888; font-size: 0.875rem; }

/* Buttons */
.btn {
    display: inline-block; padding: 10px 24px;
    background: #000; color: #fff; border: 1px solid #000;
    border-radius: 4px; font-size: 14px; cursor: pointer;
    transition: all 0.2s; text-decoration: none; line-height: 1.4;
}
.btn:hover { background: #333; border-color: #333; text-decoration: none; }
.btn-full { width: 100%; text-align: center; }
.btn-sm {
    display: inline-block; padding: 6px 14px;
    background: #000; color: #fff; border: 1px solid #000;
    border-radius: 3px; font-size: 12px; cursor: pointer;
    transition: all 0.2s; text-decoration: none;
}
.btn-sm:hover { background: #333; text-decoration: none; }
.btn-sm-outline { background: transparent; color: #333; border-color: #ccc; }
.btn-sm-outline:hover { border-color: #000; color: #000; }
.btn-sm-danger { background: transparent; color: #c0392b; border-color: #e74c3c; }
.btn-sm-danger:hover { background: #e74c3c; color: #fff; }
.btn-sm-active { background: #333; }
.btn-ai-sm {
    display: inline-block; padding: 2px 10px; font-size: 11px;
    background: transparent; color: #666; border: 1px dashed #ccc;
    border-radius: 3px; cursor: pointer; margin-left: 8px;
    vertical-align: middle; transition: all 0.2s;
}
.btn-ai-sm:hover { border-color: #000; color: #000; }
.btn-add {
    display: inline-block; padding: 8px 16px; font-size: 13px;
    background: transparent; color: #555; border: 1px dashed #ccc;
    border-radius: 4px; cursor: pointer; margin-top: 8px; width: 100%;
    transition: all 0.2s;
}
.btn-add:hover { border-color: #000; color: #000; }
.btn-remove {
    background: none; border: none; color: #c0392b; cursor: pointer;
    font-size: 12px; padding: 2px 6px;
}

/* Forms */
.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: 13px; color: #555; margin-bottom: 4px; font-weight: 500; }
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%; padding: 8px 12px;
    border: 1px solid #ddd; border-radius: 4px;
    font-size: 14px; transition: border-color 0.2s;
    font-family: inherit;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { outline: none; border-color: #000; }
.form-group textarea { resize: vertical; min-height: 80px; }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

/* Messages */
.msg { padding: 12px 16px; border-radius: 4px; font-size: 14px; margin-bottom: 16px; }
.msg-success { background: #f0fff4; color: #2f7d4f; border: 1px solid #c6f6d5; }
.msg-error { background: #fff5f5; color: #c53030; border: 1px solid #fed7d7; }

/* Cards */
.card {
    background: #fff; border: 1px solid #eee;
    border-radius: 6px; padding: 24px; margin-bottom: 16px;
}
.card-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 1px solid #eee; }

/* Auth Pages */
.auth-page {
    display: flex; justify-content: center; align-items: center;
    min-height: 100vh; background: #fafafa;
}
.auth-container { width: 100%; max-width: 400px; padding: 20px; }
.auth-card { background: #fff; border: 1px solid #eee; border-radius: 8px; padding: 40px; }
.auth-logo { display: block; font-size: 24px; font-weight: 700; text-align: center; margin-bottom: 24px; color: #000; }
.auth-logo:hover { text-decoration: none; }
.auth-title { font-size: 20px; text-align: center; margin-bottom: 4px; }
.auth-desc { font-size: 14px; color: #888; text-align: center; margin-bottom: 24px; }
.auth-form .btn { margin-top: 8px; }
.auth-footer { text-align: center; margin-top: 20px; font-size: 14px; color: #888; }
.auth-footer a { color: #000; font-weight: 500; }

/* User Navigation */
.user-nav { background: #fff; border-bottom: 1px solid #eee; position: sticky; top: 0; z-index: 100; }
.home-nav { background: #fff; border-bottom: 1px solid #eee; }
.nav-inner,
.home-nav-inner {
    max-width: 1200px; margin: 0 auto;
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 24px; height: 56px;
}
.nav-brand,
.home-brand { font-size: 18px; font-weight: 700; color: #000; }
.nav-brand:hover,
.home-brand:hover { text-decoration: none; }
.nav-links,
.home-nav-links { display: flex; align-items: center; gap: 20px; }
.nav-links a,
.home-nav-links a { font-size: 13px; color: #555; transition: color 0.2s; }
.nav-links a:hover, .nav-links a.active,
.home-nav-links a:hover, .home-nav-links a.active { color: #000; text-decoration: none; }
.nav-credits { font-size: 13px; color: #888; }
.nav-recharge { font-size: 12px; color: #2563eb !important; font-weight: 600; padding: 2px 8px; border: 1px solid #2563eb; border-radius: 3px; }
.nav-logout { font-size: 13px; color: #999 !important; }
.nav-admin-link { font-size: 13px; color: #2563eb !important; font-weight: 600; }

/* User Layout */
.user-layout { max-width: 1200px; margin: 0 auto; padding: 24px; }
.user-main { min-height: 60vh; }
.user-content { max-width: 900px; margin: 0 auto; }

/* Page Header */
.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 22px; margin-bottom: 4px; }
.page-header p { color: #888; font-size: 14px; }
.header-actions { margin-top: 12px; }

/* Stats Grid */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { border: 1px solid #eee; border-radius: 6px; padding: 20px; text-align: center; }
.stat-value { font-size: 28px; font-weight: 700; color: #000; }
.stat-label { font-size: 13px; color: #888; margin-top: 4px; }

/* Info List */
.info-list { }
.info-item { display: flex; padding: 10px 0; border-bottom: 1px solid #f5f5f5; }
.info-item:last-child { border-bottom: none; }
.info-label { width: 120px; font-size: 14px; color: #888; flex-shrink: 0; }
.info-value { font-size: 14px; color: #333; }

/* Resume Grid */
.resume-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.resume-card { border: 1px solid #eee; border-radius: 6px; overflow: hidden; transition: box-shadow 0.2s; }
.resume-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.resume-card-header { padding: 16px 16px 8px; display: flex; justify-content: space-between; align-items: flex-start; }
.resume-card-header h3 { font-size: 15px; }
.resume-status { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: #f5f5f5; color: #888; }
.resume-status.paid { background: #f0fff4; color: #2f7d4f; }
.resume-card-body { padding: 0 16px 12px; font-size: 13px; color: #888; }
.resume-card-actions { padding: 12px 16px; border-top: 1px solid #f5f5f5; display: flex; gap: 8px; flex-wrap: wrap; }

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 20px;
    min-height: 40vh;
}
.empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 { font-size: 18px; margin-bottom: 8px; }
.empty-state p { color: #888; margin-bottom: 24px; }
.empty-state .btn { min-width: 160px; }

/* Builder Page */
.builder-page { max-width: 100%; }
.builder-layout { display: flex; gap: 24px; min-height: 70vh; }
.builder-form { width: 45%; min-width: 480px; }
.builder-preview { flex: 1; position: sticky; top: 80px; align-self: flex-start; }
.builder-header { margin-bottom: 20px; display: flex; justify-content: space-between; align-items: center; }
.builder-header h2 { font-size: 18px; }
.builder-header-actions {
    display: flex;
    gap: 8px;
}

/* Form Sections */
.form-section { margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid #f0f0f0; }
.form-section h3 { font-size: 15px; margin-bottom: 12px; }

/* Entry Item */
.entry-item { border: 1px solid #eee; padding: 16px; border-radius: 4px; margin-bottom: 12px; }
.entry-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 13px; color: #888; }

/* Tags */
.tags-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag { display: inline-flex; align-items: center; padding: 4px 10px; background: #f5f5f5; border: 1px solid #e0e0e0; border-radius: 3px; font-size: 13px; }
.tag-remove { margin-left: 6px; cursor: pointer; color: #999; font-size: 16px; line-height: 1; }

/* Template Select */
.template-select { display: flex; flex-wrap: wrap; gap: 8px; }
.tpl-option {
    display: inline-block; padding: 8px 16px; border: 1px solid #ddd; border-radius: 4px; cursor: pointer; font-size: 13px; transition: all 0.2s;
}
.tpl-option.selected, .tpl-option:hover { border-color: #000; background: #000; color: #fff; }
.tpl-option input { display: none; }

/* Grammar Check Modal Styles */
.check-error-item {
    padding: 12px;
    background: #fff9f9;
    border: 1px solid #fee;
    border-radius: 4px;
    margin-bottom: 10px;
}
.check-error-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.check-error-type {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    background: #e74c3c;
    color: #fff;
}
.check-error-original {
    font-size: 13px;
    color: #555;
    margin-bottom: 4px;
    padding: 6px 8px;
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 3px;
}
.check-error-suggestion {
    font-size: 13px;
    color: #2f7d4f;
    padding: 6px 8px;
    background: #f0fff4;
    border: 1px solid #c6f6d5;
    border-radius: 3px;
}
.check-error-reason {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}
.check-no-errors {
    text-align: center;
    padding: 30px;
    color: #2f7d4f;
    font-size: 15px;
    background: #f0fff4;
    border-radius: 4px;
}
.check-score {
    font-size: 14px;
    font-weight: 700;
    color: #e67e22;
    margin-left: 10px;
}
.check-summary {
    margin-top: 12px;
    padding: 10px 14px;
    background: #f0f7ff;
    border: 1px solid #d6e8ff;
    border-radius: 4px;
    font-size: 13px;
    color: #2563eb;
}

/* Builder Preview */
.preview-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.preview-header h3 { font-size: 15px; }
.preview-frame {
    background: #fff; border: 1px solid #eee; min-height: 400px;
    padding: 32px 24px; font-size: 13px; line-height: 1.7;
}

/* Preview Resume Styles */
.preview-name { font-size: 24px; font-weight: 700; margin-bottom: 4px; }
.preview-title { font-size: 14px; color: #666; margin-bottom: 8px; }
.preview-contact { font-size: 12px; color: #999; margin-bottom: 16px; border-bottom: 1px solid #eee; padding-bottom: 12px; }
.preview-contact span { margin-right: 12px; }
.preview-summary { font-size: 13px; color: #555; line-height: 1.8; margin-bottom: 16px; }
.preview-section { margin-bottom: 16px; }
.preview-section h4 { font-size: 14px; font-weight: 600; color: #000; border-bottom: 1px solid #000; padding-bottom: 4px; margin-bottom: 8px; }
.preview-item { margin-bottom: 10px; }
.preview-item-header { display: flex; justify-content: space-between; font-weight: 600; font-size: 13px; }
.preview-item-period { color: #888; font-weight: 400; font-size: 12px; }
.preview-item-sub { font-size: 12px; color: #666; margin: 2px 0; }
.preview-item-desc { font-size: 12px; color: #555; margin-top: 2px; white-space: pre-wrap; }
.preview-skills { display: flex; flex-wrap: wrap; gap: 6px; }
.preview-skill { font-size: 12px; padding: 2px 8px; border: 1px solid #ddd; border-radius: 2px; color: #555; }

/* AI Section */
.ai-section { margin-top: 24px; padding-top: 24px; border-top: 2px solid #000; }
.ai-section h3 { font-size: 16px; margin-bottom: 4px; }

/* Payment */
.pay-methods { display: flex; gap: 12px; justify-content: center; }
.pay-method-btn {
    padding: 12px 24px; border: 1px solid #ddd; background: #fff; border-radius: 4px;
    cursor: pointer; font-size: 14px; transition: all 0.2s;
}
.pay-method-btn:hover { border-color: #000; background: #000; color: #fff; }

/* Badge */
.badge { display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: 11px; }
.badge-paid, .badge-success { background: #f0fff4; color: #2f7d4f; }
.badge-pending { background: #fffbea; color: #975a16; }
.badge-cancelled { background: #f5f5f5; color: #888; }

/* Tables */
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th { text-align: left; padding: 10px 12px; border-bottom: 2px solid #000; font-weight: 600; font-size: 13px; }
.admin-table td { padding: 10px 12px; border-bottom: 1px solid #eee; }

/* Responsive */
@media (max-width: 768px) {
    .builder-layout { flex-direction: column; }
    .builder-form { width: 100%; min-width: unset; }
    .builder-preview { position: static; }
    .nav-inner { padding: 0 16px; }
    .user-layout { padding: 16px; }
    .auth-card { padding: 24px; }
    .stats-grid { grid-template-columns: 1fr; }
    .form-row { flex-direction: column; gap: 0; }
    .resume-grid { grid-template-columns: 1fr; }
}

/* Hamburger Menu */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    width: 36px;
    height: 36px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
}
.hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: #333;
    border-radius: 1px;
    transition: all 0.3s;
}
.hamburger.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.hamburger.open span:nth-child(2) {
    opacity: 0;
}
.hamburger.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }
    .nav-links,
    .home-nav-links {
        display: none;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        background: #fff;
        border-bottom: 1px solid #eee;
        flex-direction: column;
        padding: 12px 16px;
        gap: 0;
        box-shadow: 0 4px 12px rgba(0,0,0,0.06);
        z-index: 99;
    }
    .nav-links.open,
    .home-nav-links.open {
        display: flex;
    }
    .nav-links a,
    .nav-links .nav-credits,
    .home-nav-links a {
        padding: 10px 0;
        border-bottom: 1px solid #f5f5f5;
        width: 100%;
    }
    .nav-links a:last-child,
    .nav-links .nav-credits:last-child,
    .home-nav-links a:last-child {
        border-bottom: none;
    }
}

/* Footer */
.footer {
    text-align: center;
    padding: 32px 20px;
    color: #999;
    font-size: 13px;
    border-top: 1px solid #eee;
    margin-top: 40px;
}

/* Announcement Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}
.modal-overlay.show {
    display: flex;
}
.modal-box {
    background: #fff;
    border-radius: 8px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    animation: modalIn 0.25s ease-out;
}
@keyframes modalIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.modal-header {
    padding: 20px 24px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
}
.modal-header h2 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}
.modal-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #999;
    padding: 0;
    line-height: 1;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}
.modal-close:hover {
    background: #f5f5f5;
    color: #333;
}
.modal-body {
    padding: 16px 24px;
    font-size: 14px;
    color: #555;
    line-height: 1.8;
    white-space: pre-wrap;
}
.modal-footer {
    padding: 12px 24px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}
.modal-footer .btn {
    font-size: 13px;
    padding: 8px 20px;
}
