/* CSS变量定义 */
:root {
    --primary-color: #e54646;
    --primary-hover: #a02323;
    --secondary-color: #f0a821;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --background-color: #f8fafc;
    --surface-color: #ffffff;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --border-radius: 8px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --transition: all 0.2s ease-in-out;
}

/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
}

/* 实用类 */
.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* 加载动画 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(248, 250, 252, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.3s ease-in-out;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 通知系统 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 400px;
    padding: 16px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    transform: translateX(120%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s ease, opacity 0.25s ease;
    will-change: transform, opacity;
    overflow-wrap: anywhere;
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

.notification.success {
    background-color: var(--success-color);
    color: white;
}

.notification.error {
    background-color: var(--danger-color);
    color: white;
}

.notification.warning {
    background-color: var(--warning-color);
    color: white;
}

.notification.info {
    background-color: var(--primary-color);
    color: white;
}

/* 页面布局 */
.page {
    display: none;
    min-height: 100vh;
}

.page.active {
    display: flex;
    flex-direction: column;
}

/* 认证页面样式 */
.auth-container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #fff2f2 0%, #fff8e5 100%);
}

.auth-card {
    background: var(--surface-color);
    padding: 40px;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header i {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 16px;
}

.auth-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* 表单样式 */
.auth-form,
.modal-body form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 14px;
    transition: var(--transition);
    background-color: var(--surface-color);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.password-input {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input input {
    flex: 1;
    padding-right: 80px;
}

.password-input .toggle-password,
.password-input .generate-password-inline {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition);
}

.password-input .generate-password-inline {
    right: 40px;
}

.password-input .toggle-password:hover,
.password-input .generate-password-inline:hover {
    color: var(--primary-color);
    background-color: var(--background-color);
}

/* 密码强度指示器 */
.password-strength {
    margin-top: 8px;
}

.strength-bar {
    width: 100%;
    height: 4px;
    background-color: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 4px;
}

.strength-fill {
    height: 100%;
    width: 0%;
    transition: var(--transition);
    border-radius: 2px;
}

.strength-fill.weak {
    width: 25%;
    background-color: var(--danger-color);
}

.strength-fill.fair {
    width: 50%;
    background-color: var(--warning-color);
}

.strength-fill.good {
    width: 75%;
    background-color: var(--success-color);
}

.strength-fill.strong {
    width: 100%;
    background-color: var(--success-color);
}

.strength-text {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 按钮样式 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #4b5563;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background-color: #dc2626;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background-color: #059669;
}

/* 针对密码管理与用户管理视图的按钮尺寸优化（不影响全局） */
#passwords-view .view-actions .btn,
#password-modal .btn {
    padding: 8px 14px;
    font-size: 13px;
    border-radius: 6px;
}

/* 密码列表里的操作按钮（文本版）更紧凑且不固定宽度 */
#passwords-view .password-actions button {
    height: 30px;
    width: auto;             /* override global fixed width */
    padding: 0 10px;
    font-size: 12px;
    line-height: 30px;
    white-space: nowrap;     /* keep text on one line */
    display: inline-flex;    /* shrink to content */
    align-items: center;
    justify-content: center;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
}
#passwords-view .password-actions button:hover {
    background-color: var(--background-color);
}

/* 管理员视图操作区按钮更紧凑 */
#admin-view .admin-actions .btn,
#user-modal .btn {
    padding: 8px 14px;
    font-size: 13px;
    border-radius: 6px;
}

/* 管理员用户表格中的按钮更小（由JS渲染，统一缩小） */
#admin-view .table .btn {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 6px;
}

/* 认证切换 */
.auth-switch {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.auth-switch a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* 导航栏 */
.navbar {
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    box-shadow: var(--shadow-sm);
    /* 固定在顶部，随滚动保持可见 */
    position: sticky;
    top: 0;
    z-index: 900;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 18px;
    color: var(--text-primary);
}

.navbar-brand i {
    color: var(--primary-color);
    font-size: 24px;
}

.navbar-nav {
    display: flex;
    gap: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--border-radius);
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 14px;
    transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
    background-color: var(--background-color);
    color: var(--primary-color);
}

.navbar-user .user-dropdown {
    position: relative;
}

.user-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: none;
    background: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
}

.user-button:hover {
    background-color: var(--background-color);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    padding: 8px 0;
    display: none;
    z-index: 1000;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition);
}

.dropdown-menu a:hover {
    background-color: var(--background-color);
}

.dropdown-menu hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 8px 0;
}

/* 主内容区 */
.main-content {
    flex: 1;
    padding: 24px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* 视图样式 */
.view {
    display: none;
}

.view.active {
    display: block;
}

.view-header {
    margin-bottom: 32px;
}

.view-header h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.view-header p {
    color: var(--text-secondary);
    font-size: 16px;
}

.view-actions {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

/* 分类下拉样式强化 */
#category-filter,
#password-category {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    position: relative;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 10px 44px 10px 12px; /* 右侧为下拉箭头预留空间，避免边框被遮挡 */
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.2;
    height: 40px;
    transition: var(--transition);
    background-clip: padding-box;
    background-origin: padding-box;
    outline: 1px solid transparent; /* 某些浏览器下避免边缘裁切 */
}

/* 自定义箭头（使用SVG图标，另加分隔线） */
#category-filter,
#password-category {
    background-image:
        url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236b7280'%3E%3Cpath d='M5.23 7.21a.75.75 0 011.06.02L10 10.94l3.71-3.71a.75.75 0 111.06 1.06l-4.24 4.24a.75.75 0 01-1.06 0L5.21 8.29a.75.75 0 01.02-1.08z'/%3E%3C/svg%3E"),
        linear-gradient(to right, var(--border-color), var(--border-color));
    background-position:
        right 14px center,
        calc(100% - 40px) 50%;
    background-size:
        14px 14px,
        1px 22px;
    background-repeat: no-repeat;
}

#category-filter:hover,
#password-category:hover {
    border-color: var(--primary-color);
}

#category-filter:focus,
#password-category:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(229, 70, 70, 0.12);
}

/* 在密码视图动作区，做更紧凑的尺寸 */
#passwords-view .view-actions #category-filter {
    height: 36px;
    padding: 8px 40px 8px 10px;
    font-size: 13px;
    border-radius: 6px;
}

/* 可选：使用系统原生下拉箭头（为选择器添加 .select-native 类即可） */
.select-native {
    appearance: auto !important;
    -webkit-appearance: auto !important;
    -moz-appearance: auto !important;
    background-image: none !important;
    padding-right: 12px !important;
}

/* 模态里的分类下拉与输入保持对齐 */
#password-modal #password-category {
    height: 40px;
}

/* 搜索框 */
.search-box {
    position: relative;
    flex: 1;
    min-width: 300px;
}

.search-box input {
    width: 100%;
    padding: 12px 16px;
    padding-right: 40px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 14px;
    background-color: var(--surface-color);
}

.search-box i {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background-color: var(--surface-color);
    padding: 24px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(229, 110, 70, 0.1);
}

.stat-icon i {
    font-size: 24px;
    color: var(--primary-color);
}

.stat-content h3 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.stat-content p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* 密码列表 */
.password-list {
    display: grid;
    gap: 16px;
}

.password-item {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
    cursor: pointer;
}

.password-item:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.password-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.password-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--background-color);
    color: var(--primary-color);
}

.password-details h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.password-details p {
    font-size: 14px;
    color: var(--text-secondary);
}

.password-actions {
    display: flex;
    gap: 8px;
}

.password-actions button {
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    color: var(--text-secondary);
}

.password-actions button:hover {
    background-color: var(--background-color);
    color: var(--primary-color);
}

.password-actions .delete-btn:hover {
    color: var(--danger-color);
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 32px;
}

.pagination button {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    background-color: var(--surface-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
}

.pagination button:hover:not(:disabled) {
    background-color: var(--background-color);
}

.pagination button.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 密码生成器 */
.generator-container {
    max-width: 600px;
    margin: 0 auto;
}

.generator-options {
    background-color: var(--surface-color);
    padding: 32px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 24px 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-primary);
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '\2713';
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.generated-password {
    background-color: var(--surface-color);
    padding: 32px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.password-output {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.password-output input {
    flex: 1;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-family: 'Courier New', monospace;
    font-size: 16px;
    background-color: var(--background-color);
}

/* 模态框 */
.modal {
    position: fixed;
/* 报告历史模态极简扁平化样式 */
#report-history-modal .modal-content {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 16px 0 rgba(0,0,0,0.04);
    border: 1px solid #f0f0f0;
    padding: 0;
    max-width: 520px;
}
#report-history-modal .modal-header {
    padding: 24px 24px 0 24px;
    border-bottom: none;
    background: none;
}
#report-history-modal .modal-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: #222;
    letter-spacing: 0.01em;
}
#report-history-modal .modal-close {
    font-size: 22px;
    color: #bbb;
    background: none;
    border: none;
    transition: color 0.2s;
}
#report-history-modal .modal-close:hover {
    color: #e54646;
    background: #f8fafc;
}
#report-history-modal .modal-body {
    padding: 18px 24px 12px 24px;
    background: none;
    min-height: 120px;
}
#report-history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 0;
}
.report-history-item {
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    box-shadow: none;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: border-color 0.2s;
    cursor: pointer;
    position: relative;
}
.report-history-item:hover {
    border-color: #e54646;
}
.report-history-meta {
    display: flex;
    gap: 18px;
    font-size: 13px;
    color: #888;
    margin-bottom: 2px;
}
.report-history-title {
    font-size: 15px;
    font-weight: 500;
    color: #222;
    margin-bottom: 2px;
    letter-spacing: 0.01em;
}
.report-history-desc {
    font-size: 13px;
    color: #555;
    margin-bottom: 0;
    word-break: break-all;
}
.report-history-status {
    font-size: 12px;
    font-weight: 500;
    color: #fff;
    background: #e54646;
    border-radius: 6px;
    padding: 2px 10px;
    margin-left: auto;
    align-self: flex-end;
    letter-spacing: 0.04em;
    transition: background 0.2s;
}
.report-history-status[data-status="resolved"] {
    background: #10b981;
}
.report-history-status[data-status="dismissed"] {
    background: #6b7280;
}
.report-history-status[data-status="pending"] {
    background: #e54646;
}
.report-history-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    align-items: center;
}
.report-history-actions .btn {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 6px;
    box-shadow: none;
    background: #f8fafc;
    color: #e54646;
    border: 1px solid #e5e7eb;
    transition: background 0.2s, color 0.2s;
}
.report-history-actions .btn:hover {
    background: #e54646;
    color: #fff;
    border-color: #e54646;
}
.report-history-actions .btn-secondary {
    color: #6b7280;
    border-color: #e5e7eb;
    background: #f8fafc;
}
.report-history-actions .btn-secondary:hover {
    background: #6b7280;
    color: #fff;
    border-color: #6b7280;
}
.report-history-actions .btn-success {
    color: #10b981;
    border-color: #e5e7eb;
    background: #f8fafc;
}
.report-history-actions .btn-success:hover {
    background: #10b981;
    color: #fff;
    border-color: #10b981;
}
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: var(--surface-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: var(--transition);
}

.modal.show .modal-content {
    transform: scale(1);
}

.modal-content.small {
    max-width: 400px;
}

.modal-header {
    padding: 24px 24px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition);
}

.modal-close:hover {
    background-color: var(--background-color);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 0 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* 管理员面板 */
.admin-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.tab-button {
    padding: 12px 24px;
    border: none;
    background: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
}

.tab-button.active,
.tab-button:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.admin-actions {
    margin-bottom: 24px;
}

.table-container {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background-color: var(--background-color);
    font-weight: 600;
    color: var(--text-primary);
}

.table td {
    color: var(--text-secondary);
}

.table tbody tr:hover {
    background-color: var(--background-color);
}

/* 报告统计面板 极简扁平化 */
#report-stats {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px 16px 12px 16px;
    box-shadow: var(--shadow-sm);
}

#report-stats .report-stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

#report-stats .stat-card.small {
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: none;
    background: #fff;
}

#report-stats .stat-card.small h4 {
    font-size: 22px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 4px 0;
}

#report-stats .stat-card.small p {
    font-size: 12px;
    color: #6b7280;
    margin: 0;
}

#report-stats table.table.compact {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px; /* 与上方卡片保持更舒适的间距 */
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

#report-stats table.table.compact thead th {
    background: #f9fafb;
    color: #374151;
    font-size: 13px;
    padding: 10px 12px;
}

#report-stats table.table.compact tbody td {
    font-size: 13px;
    color: #4b5563;
    padding: 10px 12px;
}

#report-stats table.table.compact tbody tr:hover {
    background: #f9fafb;
}

/* 图表已移除 */

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        height: auto;
        padding: 16px;
    }

    .navbar-nav {
        width: 100%;
        justify-content: space-around;
        margin: 16px 0;
    }

    .nav-link span {
        display: none;
    }

    .main-content {
        padding: 16px;
    }

    .view-header h2 {
        font-size: 24px;
    }

    .view-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        min-width: auto;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .password-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .password-actions {
        align-self: flex-end;
    }

    .modal-content {
        width: 95%;
        margin: 20px;
    }

    .modal-footer {
        flex-direction: column;
    }

    .auth-card {
        padding: 24px;
    }

    .generator-container {
        max-width: none;
    }

    .password-output {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .auth-container {
        padding: 12px;
    }

    .auth-card {
        padding: 20px;
    }

    .navbar-nav {
        gap: 4px;
    }

    .nav-link {
        padding: 8px 12px;
        font-size: 12px;
    }

    .main-content {
        padding: 12px;
    }

    .stat-card {
        padding: 16px;
        flex-direction: column;
        text-align: center;
    }

    .password-item {
        padding: 16px;
    }

    .modal-body {
        padding: 16px;
    }
}

/* 额外的动画和过渡效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* 焦点状态的可访问性改进 */
.btn:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000000;
        --text-secondary: #000000;
        --background-color: #ffffff;
    }
}

/* 深色模式已移除，根据需求仅保留亮色主题 */

/* 打印样式 */
@media print {
    .navbar,
    .modal,
    .notification,
    .loading-overlay {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .main-content {
        padding: 0;
    }
}

/* 覆盖运行时样式：确保移动端也固定在顶部而非底部 */
.mobile .navbar {
    position: sticky !important;
    top: 0 !important;
    bottom: auto !important;
    border-top: none !important;
    border-bottom: 1px solid var(--border-color) !important;
}
.mobile .main-content {
    /* 避免为底部导航预留的额外空间 */
    padding-bottom: 0 !important;
}