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

:root {
    --primary-color: #165DFF;
    --primary-hover: #4080FF;
    --primary-light: #E8F3FF;
    --success-color: #00B42A;
    --success-light: #E8F5E8;
    --warning-color: #FF7D00;
    --warning-light: #FFF3E0;
    --danger-color: #F53F3F;
    --danger-light: #FFF0F0;
    --text-color: #1D2129;
    --text-secondary: #4E5969;
    --text-light: #86909C;
    --border-color: #DCE0E6;
    --border-light: #F2F3F5;
    --bg-color: #F7F8FA;
    --bg-light: #F2F3F5;
    --bg-hover: #E5E6EB;
    --white: #fff;
    --stat-blue: #1565C0;
    --stat-red: #C62828;
    --stat-green: #2E7D32;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.18);
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --transition: all 0.3s ease;
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-size-base: 14px;
    --font-size-lg: 16px;
    --font-size-xl: 20px;
    --font-size-2xl: 24px;
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
}

/* 全局下拉菜单箭头样式 */
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%2386909C' d='M0 0h10L5 6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 10px 6px;
    padding-right: 36px;
    cursor: pointer;
}

select:hover {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23165DFF' d='M0 0h10L5 6z'/%3E%3C/svg%3E");
}

select:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23165DFF' d='M0 0h10L5 6z'/%3E%3C/svg%3E");
}

/* 移除 IE/Edge 默认箭头 */
select::-ms-expand {
    display: none;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.5;
    overflow-x: hidden;
    transition: var(--transition);
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
    transition: var(--transition);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* 认证页面 */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #165DFF 0%, #0E42C2 100%);
    position: relative;
    overflow: hidden;
}

.auth-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,%3Csvg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"%3E%3Cg fill="none" fill-rule="evenodd"%3E%3Cg fill="%23ffffff" fill-opacity="0.1"%3E%3Cpath d="M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z"/%3E%3C/g%3E%3C/g%3E%3C/svg%3E');
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

.auth-page::after {
    content: '';
    position: absolute;
    top: 20%;
    right: 20%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    filter: blur(60px);
    animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.2); opacity: 0.5; }
}

.auth-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.auth-card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: 48px;
    box-shadow: var(--shadow-lg);
    transform: translateY(0);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-hover));
}

.auth-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
}

.auth-card:focus-within {
    box-shadow: 0 16px 40px rgba(22, 93, 255, 0.2);
}

.auth-card h1 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 12px;
    font-size: 24px;
    font-weight: 600;
}

.auth-card .subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 40px;
    font-size: 16px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 24px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: var(--font-size-base);
    transition: var(--transition);
    background-color: var(--white);
    position: relative;
    z-index: 1;
}

.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(22, 93, 255, 0.1);
    transform: translateY(-1px);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-light);
    transition: var(--transition);
}

.form-group input:focus::placeholder,
.form-group textarea:focus::placeholder {
    color: transparent;
}

/* 表单验证状态 */
.form-group.success input,
.form-group.success select,
.form-group.success textarea {
    border-color: var(--success-color);
    box-shadow: 0 0 0 3px rgba(0, 180, 42, 0.1);
}

.form-group.error input,
.form-group.error select,
.form-group.error textarea {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 3px rgba(245, 63, 63, 0.1);
}

.form-group .error-message {
    color: var(--danger-color);
    font-size: 12px;
    margin-top: 6px;
    display: none;
    animation: slideIn 0.3s ease;
}

.form-group.error .error-message {
    display: block;
}

/* 验证码样式 */
.captcha-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.captcha-wrapper input {
    flex: 1;
    min-width: 0;
}

.captcha-image {
    height: 40px;
    width: 120px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
    background: var(--white);
}

.captcha-image:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-light);
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: var(--font-size-base);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    text-align: center;
    white-space: nowrap;
    user-select: none;
}

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

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

.btn:active {
    transform: translateY(1px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(24, 144, 255, 0.3);
    transform: translateY(-1px);
}

.btn-success {
    background-color: var(--success-color);
    color: var(--white);
}

.btn-success:hover {
    background-color: #73d13d;
    box-shadow: 0 4px 12px rgba(82, 196, 26, 0.3);
    transform: translateY(-1px);
}

.btn-danger {
    background-color: var(--danger-color);
    color: var(--white);
}

.btn-danger:hover {
    background-color: #ff7875;
    box-shadow: 0 4px 12px rgba(255, 77, 79, 0.3);
    transform: translateY(-1px);
}

.btn-warning {
    background-color: var(--warning-color);
    color: var(--white);
}

.btn-warning:hover {
    background-color: #ffc53d;
    box-shadow: 0 4px 12px rgba(250, 173, 20, 0.3);
    transform: translateY(-1px);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

.btn-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: var(--primary-light);
    transform: translateY(-1px);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 16px;
}

/* 链接样式 */
.auth-link {
    text-align: center;
    margin-top: 24px;
    color: var(--text-secondary);
}

.auth-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.auth-link a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s;
}

.auth-link a:hover::after {
    width: 100%;
}

/* 主应用布局 */
.app-container {
    display: flex;
    min-height: 100vh;
    background-color: var(--bg-color);
}

/* 侧边栏 */
.sidebar {
    width: 240px;
    background: linear-gradient(135deg, #0A1128 0%, #1A1F36 100%);
    color: var(--white);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow: hidden;
    z-index: 1000;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

/* 侧边栏遮罩层（移动端） */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1999;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backface-visibility: hidden;
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
    display: block;
}

.sidebar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.sidebar-header h2 {
    color: var(--white);
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-header h2::before {
    content: '📊';
    font-size: 24px;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    margin: 4px 8px;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.sidebar-nav li:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.nav-link {
    display: block;
    padding: 14px 24px;
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    transition: var(--transition);
    position: relative;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: var(--border-radius);
    margin: 0 12px;
}

.nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: var(--primary-color);
    opacity: 0;
    transition: var(--transition);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.nav-link:hover {
    color: var(--white);
    background-color: rgba(22, 93, 255, 0.1);
    transform: translateX(4px);
}

.nav-link.active {
    color: var(--white);
    background-color: rgba(22, 93, 255, 0.15);
    box-shadow: 0 2px 8px rgba(22, 93, 255, 0.2);
}

.nav-link:hover::before,
.nav-link.active::before {
    opacity: 1;
}

.nav-link i {
    font-size: 16px;
    transition: var(--transition);
}

.nav-link:hover i,
.nav-link.active i {
    color: var(--primary-color);
    transform: scale(1.1);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.sidebar-footer .btn {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.sidebar-footer .btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: var(--primary-color);
}

/* 主内容区域 */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    margin-left: 240px;
    width: calc(100% - 240px);
}

/* 顶部栏 */
.top-bar {
    height: 64px;
    background-color: var(--white);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-light);
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--text-color);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.menu-toggle:hover {
    background-color: var(--bg-light);
    color: var(--primary-color);
}

.account-set-selector {
    display: flex;
    align-items: center;
    gap: 16px;
}

.account-set-selector label {
    font-weight: 500;
    color: var(--text-color);
    white-space: nowrap;
}

.account-set-selector select {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    min-width: 240px;
    font-size: 14px;
    transition: var(--transition);
    background-color: var(--white);
}

.account-set-selector select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(22, 93, 255, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.user-avatar {
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
}

.user-info span {
    font-weight: 500;
    color: var(--text-color);
    font-size: 14px;
}

/* 页面内容 */
.page-content {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
    background-color: var(--bg-color);
}

.page {
    display: none;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page.active {
    display: block;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-color);
}

.page-header h2 {
    font-size: var(--font-size-2xl);
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.page-header h2 .title-select {
    margin-left: 16px;
    padding: 8px 16px;
    min-width: 120px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: normal;
    background-color: var(--white);
    vertical-align: middle;
    transition: var(--transition);
}

.page-header h2 .title-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(22, 93, 255, 0.1);
}

.page-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-header-actions input {
    transition: all 0.2s ease;
}

.page-header-actions input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-light);
}

/* 账簿查询搜索框 */
#ledgerSearch {
    width: 250px;
    line-height: 32px;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 14px;
}

/* 凭证搜索框 */
#voucherSearch {
    width: 200px;
    line-height: 32px;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 14px;
}

#voucherTotalCount {
    color: var(--text-secondary);
    font-size: 14px;
}

.filter-panel {
    background: var(--white);
    padding: 24px;
    border-radius: 8px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* 分页样式 */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background-color: var(--white);
    border-radius: var(--border-radius-lg);
    margin-top: 16px;
    box-shadow: var(--shadow);
}

.pagination-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-secondary);
}

.pagination-info select {
    padding: 6px 12px;
    min-width: 100px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 14px;
    cursor: pointer;
    background-color: var(--white);
}

.pagination {
    display: flex;
    gap: 8px;
    align-items: center;
}

.pagination button {
    min-width: 60px;
}

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

.pagination button:not(:disabled):hover {
    background-color: var(--primary-color);
    color: var(--white);
}

/* 表格容器 */
.table-container {
    background-color: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}

.table-container:hover {
    box-shadow: var(--shadow-hover);
}

/* 数据表格 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th,
.data-table td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
    transition: var(--transition);
}

.data-table th {
    background-color: var(--bg-light);
    font-weight: 600;
    color: var(--text-color);
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 2px solid var(--primary-color);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.data-table tbody tr {
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.data-table tbody tr:hover {
    background-color: var(--primary-light);
    transform: translateX(4px);
    border-left-color: var(--primary-color);
}

.data-table tbody tr:nth-child(even) {
    background-color: rgba(22, 93, 255, 0.02);
}

.data-table tbody tr:nth-child(even):hover {
    background-color: var(--primary-light);
}

.data-table .actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* 状态标签 */
.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 25px;
    height: 25px;
    padding: 0 6px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    border: 1px solid transparent;
}

.status-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.status-badge:hover::before {
    left: 100%;
}

.status-badge:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.status-badge.active {
    background-color: var(--success-light);
    color: var(--success-color);
    border-color: var(--success-color);
}

.status-badge.inactive {
    background-color: var(--warning-light);
    color: var(--warning-color);
    border-color: var(--warning-color);
}

.status-badge.draft {
    background-color: var(--bg-light);
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.status-badge.reviewed {
    background-color: var(--primary-light);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.status-badge.posted {
    background-color: var(--success-light);
    color: var(--success-color);
    border-color: var(--success-color);
}

.status-badge.created {
    background-color: var(--warning-light);
    color: var(--warning-color);
    border-color: var(--warning-color);
}

.status-badge.void {
    background-color: var(--danger-light);
    color: var(--danger-color);
    border-color: var(--danger-color);
}

/* 文字状态标签 - 用于账套管理、会计科目等 */
.status-badge-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    transition: var(--transition);
    border: 1px solid transparent;
    white-space: nowrap;
}

.status-badge-text.active {
    background-color: var(--success-light);
    color: var(--success-color);
    border-color: var(--success-color);
}

.status-badge-text.inactive {
    background-color: var(--warning-light);
    color: var(--warning-color);
    border-color: var(--warning-color);
}

/* 凭证详情优化 */
.voucher-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
    padding: 20px;
    background-color: var(--bg-light);
    border-radius: var(--border-radius-md);
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.info-item.full-width {
    grid-column: 1 / -1;
}

.info-item label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.info-item span {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 600;
}

.voucher-entries-section {
    margin-top: 20px;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 12px;
}

.account-code {
    font-size: 12px;
    font-weight: 300;
    color: var(--primary-color);
    font-family: 'Monaco', 'Consolas', monospace;
}

.account-name {
    color: var(--text-primary);
}

.debit {
    color: var(--success-color);
}

.credit {
    color: var(--danger-color);
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: var(--white);
    border-radius: var(--border-radius-lg);
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: scale(0.9);
    animation: scaleIn 0.3s ease forwards;
    position: relative;
    border: 1px solid var(--border-light);
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-hover));
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

@keyframes scaleIn {
    to {
        transform: scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    border-bottom: 1px solid var(--border-light);
    background-color: var(--bg-light);
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
    padding: 4px;
    border-radius: 4px;
}

.modal-close:hover {
    color: var(--text-color);
    background-color: var(--bg-light);
}

.modal-body {
    padding: 32px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    padding: 24px 32px;
    border-top: 1px solid var(--border-light);
    background-color: var(--bg-light);
    border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
}

/* 模态框确认内容通用样式 */
.confirm-content {
    text-align: center;
}

.confirm-content .form-group {
    text-align: left;
    margin-bottom: 16px;
}

.confirm-content .form-group label {
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 8px;
    display: block;
}

.confirm-content .form-group input,
.confirm-content .form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 15px;
    transition: var(--transition);
    background-color: var(--white);
    cursor: pointer;
}

.confirm-content .form-group input:focus,
.confirm-content .form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* 备份确认弹窗 */
.backup-confirm-content {
    text-align: center;
}

.backup-warning {
    padding: 24px;
    background: linear-gradient(135deg, #FFF7E6 0%, #FFECE0 100%);
    border-radius: var(--border-radius);
    margin-bottom: 24px;
    border: 1px solid #FFD591;
}

.backup-warning svg {
    color: var(--warning-color);
    margin-bottom: 12px;
}

.backup-warning p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 15px;
}

.backup-warning strong {
    color: var(--text-color);
}

.backup-confirm-content .form-group {
    margin-bottom: 0;
}

/* 账套卡片 */
.account-set-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    padding: 4px;
}

.account-set-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    transition: var(--transition);
}

.account-set-card:hover {
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

.account-set-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px;
    background: linear-gradient(135deg, var(--bg-light) 0%, var(--white) 100%);
    border-bottom: 1px solid var(--border-light);
}

.account-set-card .card-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.account-set-card .card-code {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.account-set-card .card-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
}

.account-set-card .card-body {
    padding: 16px 20px;
}

.account-set-card .card-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.account-set-card .info-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.account-set-card .info-label {
    font-size: 12px;
    color: var(--text-light);
}

.account-set-card .info-value {
    font-size: 14px;
    color: var(--text-color);
    font-weight: 500;
}

.account-set-card .card-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-footer-left {
    display: flex;
    gap: 8px;
}

.card-footer-right {
    display: flex;
    gap: 8px;
}

/* 克隆账套模态框 */
.clone-confirm-content {
    text-align: center;
}

.clone-info {
    padding: 24px;
    background: linear-gradient(135deg, #E8F3FF 0%, #F0F5FF 100%);
    border-radius: var(--border-radius);
    margin-bottom: 24px;
    border: 1px solid #B3D8FF;
}

.clone-info svg {
    color: var(--primary-color);
    margin-bottom: 12px;
}

.clone-info p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 15px;
}

.clone-info strong {
    color: var(--text-color);
}

.clone-hint {
    margin-top: 8px !important;
    font-size: 13px !important;
    color: var(--text-light) !important;
}

.clone-confirm-content .checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
    margin-bottom: 0;
}

.clone-confirm-content .checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.clone-confirm-content .checkbox-hint {
    display: block;
    margin-top: 4px;
    margin-left: 28px;
    color: var(--text-light);
    font-size: 12px;
}

/* 转移账套模态框 */
.transfer-confirm-content {
    text-align: center;
}

.transfer-info {
    padding: 24px;
    background: linear-gradient(135deg, #FFF0F6 0%, #FFF5F8 100%);
    border-radius: var(--border-radius);
    margin-bottom: 24px;
    border: 1px solid #FFD6E7;
}

.transfer-info svg {
    color: #F53F3F;
    margin-bottom: 12px;
}

.transfer-info p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 15px;
}

.transfer-info strong {
    color: var(--text-color);
}

.transfer-hint {
    margin-top: 8px !important;
    font-size: 13px !important;
    color: var(--text-light) !important;
}

.transfer-confirm-content .form-group {
    margin-bottom: 0;
}

/* 提示框 */
.toast {
    position: fixed;
    top: 24px;
    right: 24px;
    padding: 16px 24px;
    background-color: var(--success-color);
    color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    display: none;
    animation: slideIn 0.3s ease;
    max-width: 320px;
    font-weight: 500;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.toast::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.3);
}

.toast::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background-color: rgba(255, 255, 255, 0.5);
    width: 100%;
    animation: toastProgress 3s ease-out forwards;
}

@keyframes toastProgress {
    from { width: 100%; }
    to { width: 0; }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.show {
    display: block;
}

.toast.error {
    background-color: var(--danger-color);
}

.toast.warning {
    background-color: var(--warning-color);
}

/* 仪表盘统计 */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-top: 32px;
}

.stat-card {
    background-color: var(--white);
    padding: 20px;
    margin-bottom: 20px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-hover));
}

.stat-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

.stat-card h3 {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-card h3::before {
    content: '';
    width: 4px;
    height: 16px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

.stat-card .stat-change {
    font-size: 12px;
    font-weight: 500;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-card .stat-change.positive {
    color: var(--success-color);
}

.stat-card .stat-change.negative {
    color: var(--danger-color);
}

/* 仪表盘卡片标题 */
.stat-card-title {
    margin-bottom: 15px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    font-size: 16px;
    font-weight: 600;
}

.stat-card-title::before {
    display: none;
}

/* 仪表盘网格布局 */
.stat-grid {
    display: grid;
    gap: 15px;
    text-align: center;
}

.stat-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-value {
    font-size: 24px;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.stat-value-sm {
    font-size: 14px;
}

.stat-value-blue {
    color: var(--stat-blue);
}

.stat-value-red {
    color: var(--stat-red);
}

.stat-value-green {
    color: var(--stat-green);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 13px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-bar select {
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    min-width: 200px;
    transition: var(--transition);
    background-color: var(--white);
}

.filter-bar select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(22, 93, 255, 0.1);
}

/* 报表标签 */
.report-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
    border-bottom: 2px solid var(--border-light);
}

.tab-btn {
    padding: 12px 24px;
    border: none;
    background-color: transparent;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    position: relative;
}

.tab-btn:hover,
.tab-btn.active {
    color: var(--primary-color);
    background-color: var(--primary-light);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--primary-color);
}

/* 报表表格 */
.report-table {
    width: 100%;
    background-color: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}

.report-table:hover {
    box-shadow: var(--shadow-hover);
}

.report-table th,
.report-table td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.report-table th {
    background-color: var(--bg-light);
    font-weight: 600;
    color: var(--text-color);
}

.report-table .total-row {
    font-weight: 600;
    background-color: var(--primary-light);
    color: var(--primary-color);
}

/* 凭证分录 */
.voucher-entry {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
    padding: 16px;
    background-color: var(--bg-light);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: visible;
}

.voucher-entry .form-group {
    margin-bottom: 0;
}

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

.voucher-entry-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #2d2d2d;
    color: var(--white);
    border-radius: 50%;
    font-weight: 600;
}

.voucher-entry-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.voucher-entry-row.amounts-row {
    display: grid;
    grid-template-columns: 1fr 1fr 80px auto;
    gap: 12px;
    align-items: end;
}

.voucher-entry .account-search-wrapper {
    flex: 1;
}

.entry-actions {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

/* 借方金额样式 */
.debit-input-group {
    position: relative;
}

.debit-input-group::before {
    content: '借';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--success-color);
    font-weight: 500;
    font-size: 13px;
    z-index: 1;
}

.debit-input {
    text-align: right;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 500;
    padding-left: 32px !important;
    background-color: #f0fff4 !important;
}

/* 贷方金额样式 */
.credit-input-group {
    position: relative;
}

.credit-input-group::before {
    content: '贷';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--danger-color);
    font-weight: 500;
    font-size: 13px;
    z-index: 1;
}

.credit-input {
    text-align: right;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 500;
    padding-left: 32px !important;
    background-color: #fff5f5 !important;
}

.amount-input {
    text-align: right;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 500;
}

/* 工具类 */
.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.mt-32 {
    margin-top: 32px;
}

.mb-32 {
    margin-bottom: 32px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

/* 响应式设计 */
/* 小屏幕（小于1366px）默认隐藏侧边栏 */
@media (max-width: 1365px) {
    .sidebar {
        width: 260px;
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 2000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        will-change: transform;
        backface-visibility: hidden;
        perspective: 1000;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .sidebar-overlay.show {
        opacity: 1;
        visibility: visible;
        display: block;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .menu-toggle {
        display: flex;
        background: var(--bg-light);
        border: 1px solid var(--border-color);
        padding: 8px 12px;
        color: var(--text-color);
        border-radius: var(--border-radius);
        transition: var(--transition);
        cursor: pointer;
    }
    
    .menu-toggle:hover {
        background-color: var(--primary-color);
        color: var(--white);
        border-color: var(--primary-color);
    }
    
    .account-set-selector label {
        display: none;
    }
    
    .account-set-selector {
        flex: 1;
    }
    
    .account-set-selector select {
        min-width: 180px;
        width: 100%;
    }
    
    .user-info span {
        font-size: 13px;
    }
}

/* 平板设备（小于768px） */
@media (max-width: 768px) {
    .auth-container {
        padding: 16px;
    }
    
    .auth-card {
        padding: 32px;
    }
    
    .captcha-wrapper {
        flex-wrap: wrap;
    }
    
    .captcha-wrapper input {
        flex: 1 1 100%;
        min-width: 0;
    }
    
    .captcha-image {
        flex: 0 0 auto;
        margin-top: 8px;
        width: 120px;
        height: 44px;
    }
    
    .sidebar {
        width: 260px;
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 2000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        will-change: transform;
        backface-visibility: hidden;
        perspective: 1000;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .sidebar-overlay.show {
        opacity: 1;
        visibility: visible;
        display: block;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .top-bar {
        padding: 0 16px;
    }
    
    .account-set-selector label {
        display: none;
    }
    
    .account-set-selector select {
        min-width: 140px;
    }
    
    .grid-2 {
        grid-template-columns: 1fr;
    }
    
    .grid-3 {
        grid-template-columns: 1fr;
    }
    
    .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    /* 仪表盘统计卡片内部 - 2列显示 */
    .stat-grid-3 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    /* 表格水平滚动 */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .data-table {
        min-width: 700px;
    }
    
    .data-table th,
    .data-table td {
        padding: 12px 14px;
        white-space: nowrap;
    }
    
    /* 模态框全屏 */
    .modal-content {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 16px;
    }
    
    /* 分录卡片 */
    .voucher-entry {
        padding: 12px;
    }
    
    .voucher-entry-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .voucher-entry-row.amounts-row {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    /* 分页 */
    .pagination-container {
        flex-direction: column;
        gap: 12px;
    }
    
    .pagination-info {
        width: 100%;
        justify-content: center;
    }
    
    .pagination {
        width: 100%;
        justify-content: center;
    }
    
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-bar select,
    .filter-bar input {
        width: 100%;
    }
    
    .filter-bar .btn {
        width: 100%;
    }
    
    .filter-bar .account-search-wrapper {
        min-width: 0;
        width: 100%;
    }
    
    /* 页面头部 */
    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .page-header h2 {
        font-size: 20px;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    
    .page-header h2 .title-select {
        margin-left: 0;
        margin-top: 4px;
        width: 100%;
    }
    
    /* 凭证管理页面标题单独成行 */
    .page-header > div:first-child {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .page-header > div:first-child > h2 {
        margin-bottom: 0;
    }
    
    .page-header > div:first-child > div {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .page-header > div:first-child input[type="text"] {
        flex: 1;
        min-width: 120px;
    }
    
    /* 按钮组优化 - 全宽显示 */
    .page-header > div:last-child,
    .page-header-actions {
        display: flex;
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }
    
    .page-header .btn {
        width: 100%;
    }
    
    /* 账簿查询搜索框移动端样式 */
    #ledgerSearch {
        width: 100%;
    }
    
    /* 凭证搜索框移动端样式 */
    #voucherSearch {
        width: 100%;
        flex: 1;
    }
    
    #voucherTotalCount {
        display: none;
    }
    
    /* 日记账页面标题 */
    #journal-page .page-header > div:first-child {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }
    
    /* 财务报表页面 */
    .report-tabs {
        flex-wrap: wrap;
    }
    
    .tab-btn {
        flex: 1;
        min-width: 80px;
        text-align: center;
        padding: 10px 12px;
        font-size: 13px;
    }
}

/* 平板设备（小于768px） */
@media (max-width: 767px) {
    /* 隐藏用户信息 */
    .user-info {
        display: none;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 24px 16px;
    }
    
    .auth-card h1 {
        font-size: 20px;
    }
    
    .page-content {
        padding: 12px;
    }
    
    .top-bar {
        height: 56px;
        padding: 0 12px;
    }
    
    /* 隐藏用户信息 */
    .user-info {
        display: none;
    }
    
    .account-set-selector select {
        width: 100%;
        min-width: 120px;
        font-size: 13px;
    }
    
    /* 隐藏分页首末按钮 */
    #voucherFirstPage,
    #voucherLastPage,
    #journalFirstPage,
    #journalLastPage {
        display: none;
    }
    
    /* 统计卡片优化 */
    .stat-card {
        padding: 16px;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    /* 分录金额行 */
    .voucher-entry-row.amounts-row {
        grid-template-columns: 1fr 1fr;
    }
}

/* Profile Page Styles */
.profile-container {
    min-width: 748px;
    max-width: 1000px;
    margin: 0;
    padding: 30px;
}

.profile-header {
    margin-bottom: 20px;
}

.profile-header h1 {
    margin: 0 0 4px 0;
    color: var(--text-color);
    font-size: 22px;
    font-weight: 600;
}

.profile-header p {
    margin: 0;
    color: var(--text-light);
    font-size: 13px;
}

.profile-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--border-light);
}

.profile-tab {
    padding: 12px 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
    white-space: nowrap;
}

.profile-tab:hover {
    color: var(--primary-color);
}

.profile-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.profile-section {
    display: none;
}

.profile-section.active {
    display: block;
}

.profile-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}

.profile-card h2 {
    margin: 0;
    color: var(--text-color);
    font-size: 15px;
    font-weight: 600;
}

.profile-card h3 {
    margin: 30px 0 18px 0;
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 600;
}

.profile-info {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 15px;
    margin-bottom: 20px;
    background: var(--bg-light);
    padding: 20px;
    border-radius: 6px;
}

.info-label {
    font-weight: 500;
    color: var(--text-light);
    font-size: 14px;
}

.info-value {
    color: var(--text-color);
    font-weight: 500;
    font-size: 14px;
}

.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}

.api-key-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.api-key-item {
    background: var(--bg-light);
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 15px;
    border: 1px solid var(--border-light);
}

.api-key-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.api-key-name {
    font-weight: 600;
    color: var(--text-color);
    font-size: 16px;
}

.api-key-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.api-key-code {
    font-family: 'Courier New', monospace;
    border: solid 1px var(--primary-color);
    background: var(--bg-color);
    color: var(--primary-color);
    padding: 8px 14px;
    border-radius: 4px;
    margin-bottom: 12px;
    font-size: 13px;
    display: inline-block;
}

.api-key-meta {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    font-size: 13px;
    color: var(--text-light);
    background: rgba(0, 0, 0, 0.02);
    padding: 12px;
    border-radius: 4px;
}

.status-badge.expired {
    background: var(--warning-color);
    color: var(--white);
}

.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-light);
}

.empty-state p {
    font-size: 14px;
    margin-bottom: 15px;
}

/* 可搜索科目下拉框样式 */
.account-search-wrapper {
    position: relative;
}

.account-search-wrapper::after {
    content: '';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid var(--text-light);
    pointer-events: none;
    transition: border-color 0.2s;
}

.account-search-wrapper:hover::after {
    border-top-color: var(--primary-color);
}

.account-search-wrapper input {
    padding-right: 40px !important;
    cursor: pointer;
}

.account-search-wrapper .account-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 300px;
    overflow-y: auto;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    margin-top: 4px;
}

.account-search-wrapper .account-option {
    padding: 10px 14px;
    cursor: pointer;
    transition: background-color 0.15s;
    font-size: 14px;
}

.account-search-wrapper .account-option:not(:last-child) {
    border-bottom: 1px solid var(--border-light);
}

.account-search-wrapper .account-option:hover,
.account-search-wrapper .account-option.active {
    background-color: var(--primary-light);
}

.account-search-wrapper .account-option.active {
    background-color: var(--primary-light);
    border-left: 3px solid var(--primary-color);
}

/* ==================== 账簿查询模块样式 ==================== */

/* 现代化筛选面板 */
.ledger-filter-panel {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: 20px 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

.ledger-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-end;
}

.ledger-filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ledger-filter-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

.period-select-group {
    display: flex;
    gap: 6px;
    align-items: center;
}

.period-select-group select {
    min-width: 90px;
    padding: 8px 32px 8px 12px;
    height: 38px;
    font-size: 13px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--white);
    transition: all 0.2s ease;
    cursor: pointer;
}

.period-select-group select:hover {
    border-color: var(--primary-hover);
    background-color: var(--primary-light);
}

.period-select-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.period-select-group::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid var(--text-light);
    pointer-events: none;
}

/* 期间选择器连接符 */
.period-separator {
    color: var(--text-light);
    font-size: 14px;
    padding: 0 2px;
}

.filter-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.filter-actions .btn {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 16px;
    font-size: 14px;
}

.filter-actions .btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #4080FF 100%);
    border: none;
    box-shadow: 0 2px 8px rgba(22, 93, 255, 0.3);
}

.filter-actions .btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, #5A9AFF 100%);
    box-shadow: 0 4px 12px rgba(22, 93, 255, 0.4);
    transform: translateY(-1px);
}

/* 科目输入框现代化 */
.ledger-account-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 14px;
    transition: all 0.2s ease;
    background: var(--white);
}

.ledger-account-input:hover {
    border-color: var(--primary-hover);
}

.ledger-account-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* 账簿汇总信息 */
.ledger-summary {
    background: linear-gradient(135deg, var(--primary-light) 0%, #E8F3FF 100%);
    padding: 16px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    border: 1px solid rgba(22, 93, 255, 0.15);
}

.ledger-summary-info {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.ledger-summary-info span {
    font-size: 14px;
    color: var(--text-secondary);
}

.ledger-summary-info strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* 账簿卡片样式 */
.ledger-card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    overflow: hidden;
    transition: all 0.25s ease;
}

.ledger-card:hover {
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.ledger-card-header {
    background: linear-gradient(135deg, #F8F9FA 0%, #F2F3F5 100%);
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.ledger-card-header:hover {
    background: linear-gradient(135deg, #F0F4FF 0%, #E8F3FF 100%);
}

.ledger-card-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.ledger-card-code {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary-color);
    font-family: 'Monaco', 'Consolas', monospace;
    background: var(--primary-light);
    padding: 4px 10px;
    border-radius: 4px;
}

.ledger-card-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-color);
}

.ledger-card-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-secondary);
}

.ledger-card-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ledger-card-direction {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.ledger-card-direction.debit {
    background: #FFF0F0;
    color: var(--danger-color);
}

.ledger-card-direction.credit {
    background: #E8F5E8;
    color: var(--success-color);
}

.ledger-card-expand {
    color: var(--primary-color);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: transform 0.2s ease;
}

.ledger-card-expand.expanded {
    transform: rotate(180deg);
}

.ledger-card-body {
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.ledger-card-body.expanded {
    padding: 16px 20px;
    max-height: 1000px;
}

/* 账簿表格样式 */
.ledger-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.ledger-table thead {
    background: #F8F9FA;
    position: sticky;
    top: 0;
}

.ledger-table th {
    padding: 12px 10px;
    text-align: center;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.ledger-table th:first-child {
    text-align: left;
}

.ledger-table th:last-child {
    text-align: right;
}

.ledger-table td {
    padding: 10px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.ledger-table td:first-child {
    text-align: left;
}

.ledger-table td:last-child {
    text-align: right;
    font-weight: 500;
}

.ledger-table tbody tr:hover {
    background: var(--primary-light);
}

.voucher-link {
    color: var(--primary-color);
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;
    font-family: 'Monaco', 'Consolas', monospace;
}

.voucher-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.ledger-table .voucher-link {
}

.ledger-table .debit {
    color: var(--danger-color);
    font-weight: 500;
}

.ledger-table .credit {
    color: var(--success-color);
    font-weight: 500;
}

.ledger-table .empty-cell {
    color: var(--text-light);
}

/* 余额方向指示 */
.balance-direction {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.balance-direction.positive {
    background: var(--success-light);
    color: var(--success-color);
}

.balance-direction.negative {
    background: var(--danger-light);
    color: var(--danger-color);
}

/* 账簿详情页 */
.ledger-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
}

.ledger-detail-back {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    font-weight: 500;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: var(--border-radius);
    transition: all 0.2s;
}

.ledger-detail-back:hover {
    background: var(--primary-light);
}

.ledger-detail-info {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    align-items: center;
}

.ledger-detail-account {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ledger-detail-account .code {
    font-weight: 700;
    color: var(--primary-color);
    font-family: monospace;
    font-size: 16px;
}

.ledger-detail-account .name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
}

.ledger-detail-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.ledger-detail-stat {
    text-align: center;
    padding: 12px 20px;
    background: var(--white);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-light);
    min-width: 120px;
}

.ledger-detail-stat .label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.ledger-detail-stat .value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
}

.ledger-detail-stat .value.positive {
    color: var(--success-color);
}

.ledger-detail-stat .value.negative {
    color: var(--danger-color);
}

/* 账簿搜索框 */
.ledger-detail-search {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--white);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-light);
    align-items: center;
    flex-wrap: wrap;
}

.ledger-detail-search input {
    flex: 1;
    min-width: 200px;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 14px;
}

.ledger-detail-search input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* 账簿空状态 */
.ledger-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.ledger-empty svg {
    color: var(--text-light);
    margin-bottom: 16px;
}

.ledger-empty h3 {
    font-size: 18px;
    color: var(--text-color);
    margin-bottom: 8px;
}

.ledger-empty p {
    font-size: 14px;
    color: var(--text-light);
}

/* 返回按钮 */
.ledger-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 16px;
}

.ledger-back-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* 科目详情卡片 */
.ledger-detail-card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: 20px 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

.ledger-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.ledger-detail-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.ledger-detail-title .account-code {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    font-family: 'Monaco', 'Consolas', monospace;
    background: var(--primary-light);
    padding: 4px 12px;
    border-radius: 6px;
}

.ledger-detail-title .account-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
}

.ledger-detail-title .account-direction {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.ledger-detail-title .account-direction.debit {
    background: #FFF0F0;
    color: var(--danger-color);
}

.ledger-detail-title .account-direction.credit {
    background: #E8F5E8;
    color: var(--success-color);
}

.ledger-detail-stats {
    display: flex;
    gap: 24px;
}

.ledger-detail-stats .stat-item {
    text-align: center;
}

.ledger-detail-stats .stat-label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.ledger-detail-stats .stat-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
}

.ledger-detail-stats .stat-value.positive {
    color: var(--success-color);
}

.ledger-detail-stats .stat-value.negative {
    color: var(--danger-color);
}

/* 搜索框 */
.ledger-search-box {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-input-wrapper {
    flex: 1;
    min-width: 250px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrapper svg {
    position: absolute;
    left: 14px;
    color: var(--text-light);
}

.search-input-wrapper input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 14px;
    transition: all 0.2s ease;
}

.search-input-wrapper input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.search-actions {
    display: flex;
    gap: 8px;
}

/* 表格容器 */
.ledger-table-wrapper {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

.ledger-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.ledger-table thead {
    background: linear-gradient(135deg, #F8F9FA 0%, #F2F3F5 100%);
}

.ledger-table th {
    padding: 14px 12px;
    text-align: center;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ledger-table th.col-voucher {
    text-align: left;
    width: 120px;
}

.ledger-table th.col-date {
    width: 110px;
}

.ledger-table th.col-desc {
    text-align: left;
}

.ledger-table th.col-amount {
    width: 140px;
    text-align: right;
}

.ledger-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
    font-size: 14px;
}

.ledger-table td.col-voucher {
    text-align: left;
}

.ledger-table td.col-date {
    text-align: center;
    color: var(--text-secondary);
}

.ledger-table td.col-desc {
    text-align: left;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ledger-table td.col-amount {
    text-align: right;
}

.ledger-table td.amount-debit {
    color: var(--danger-color);
    font-weight: 500;
}

.ledger-table td.amount-credit {
    color: var(--success-color);
    font-weight: 500;
}

.ledger-table td.amount-balance {
    font-weight: 600;
    color: var(--text-color);
}

.ledger-table td .empty {
    color: var(--text-light);
}

.ledger-table tbody tr {
    transition: background-color 0.15s ease;
}

.ledger-table tbody tr:hover {
    background: var(--primary-light);
}

.ledger-table .voucher-link {
    color: var(--primary-color);
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 12px;
}

.ledger-table .voucher-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* 分页 */
.ledger-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
    padding: 16px;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

.ledger-pagination .page-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--white);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.ledger-pagination .page-btn:hover:not([disabled]) {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.ledger-pagination .page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ledger-pagination .page-info {
    padding: 0 16px;
    font-size: 14px;
    color: var(--text-secondary);
}

.ledger-pagination .page-info strong {
    color: var(--primary-color);
}

.ledger-empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: var(--bg-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ledger-empty-icon svg {
    width: 40px;
    height: 40px;
    color: var(--text-light);
}

.ledger-empty h3 {
    font-size: 18px;
    color: var(--text-color);
    margin-bottom: 8px;
}

.ledger-empty p {
    font-size: 14px;
    color: var(--text-light);
}

/* 账簿加载状态 */
.ledger-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 16px;
}

.ledger-loading .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* 响应式 */
@media (max-width: 768px) {
    .ledger-filter-panel {
        padding: 16px;
    }

    .ledger-filter-row {
        flex-direction: column;
        align-items: stretch;
    }

    .ledger-filter-group {
        width: 100%;
    }

    .ledger-filter-group .account-search-wrapper {
        min-width: 100%;
    }

    .ledger-card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .ledger-card-meta {
        margin-top: 8px;
    }

    .ledger-table {
        font-size: 12px;
    }

    .ledger-table th,
    .ledger-table td {
        padding: 8px 6px;
    }

    .ledger-detail-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .ledger-detail-stats {
        width: 100%;
    }

    .ledger-detail-stat {
        flex: 1;
        min-width: 80px;
    }
}

@media (max-width: 768px) {
    .profile-container {
        min-width: 100%;
        padding: 20px 15px;
    }
    
    .profile-header h1 {
        font-size: 24px;
    }
    
    .profile-tabs {
        overflow-x: auto;
    }
    
    .profile-tab {
        flex-shrink: 0;
    }
    
    .profile-card {
        padding: 20px;
    }
    
    .profile-info {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .api-key-meta {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

/* 滑块开关样式 */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: var(--transition);
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: var(--transition);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--primary-color);
}

.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(22, 93, 255, 0.2);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.toggle-switch:hover .toggle-slider {
    background-color: var(--text-light);
}

.toggle-switch input:checked + .toggle-slider:hover {
    background-color: var(--primary-hover);
}

.toggle-switch input:disabled + .toggle-slider {
    background-color: var(--border-light);
    cursor: not-allowed;
}

.toggle-switch input:disabled + .toggle-slider:before {
    background-color: var(--text-light);
    box-shadow: none;
}

/* ========== 操作日志样式 ========== */

/* 日志筛选栏 */
.log-filter-bar {
    background: var(--bg-light);
    padding: 16px;
    border-radius: var(--border-radius);
    margin-bottom: 0;
}

.filter-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.filter-row:last-child {
    margin-bottom: 0;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 120px;
}

.filter-group label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
}

.filter-group select,
.filter-group input {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 13px;
    background: var(--white);
    transition: var(--transition);
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-light);
}

/* 日志统计卡片 */
.log-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.log-stats .stat-item {
    text-align: center;
    padding: 12px 16px;
    background: var(--bg-light);
    border-radius: var(--border-radius);
}

.log-stats .stat-label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.log-stats .stat-value {
    font-size: 24px;
    font-weight: 600;
    color: var(--primary-color);
}

/* 日志列表头部 */
.log-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.log-list-header h2 {
    margin: 0;
    border-bottom: none;
    padding-bottom: 0;
    font-size: 15px;
}

/* 日志表格 - 精简样式 */
.log-table {
    font-size: 13px;
}

.log-table th,
.log-table td {
    padding: 10px 12px;
}

.log-table th {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-light);
}

.log-table .log-time {
    white-space: nowrap;
    color: var(--text-secondary);
    font-size: 12px;
}

.log-table .log-description {
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.log-table .log-row-failure {
    background-color: #fff5f5 !important;
}

.log-table .log-row-failure:hover {
    background-color: #ffebeb !important;
}

/* 操作类型标签 - 精简 */
.log-action {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

.log-action-create {
    background-color: #e6f7ff;
    color: #1890ff;
}

.log-action-update {
    background-color: #fff7e6;
    color: #fa8c16;
}

.log-action-delete {
    background-color: #fff1f0;
    color: #f5222d;
}

.log-action-import {
    background-color: #f6ffed;
    color: #52c41a;
}

.log-action-export {
    background-color: #f9f0ff;
    color: #722ed1;
}

.log-action-void {
    background-color: #f5f5f5;
    color: #8c8c8c;
}

.log-action-post {
    background-color: #e6fffb;
    color: #13c2c2;
}

.log-action-unpost {
    background-color: #fff0f6;
    color: #eb2f96;
}

.log-action-login {
    background-color: #e6f7ff;
    color: #1890ff;
}

.log-action-logout {
    background-color: #f5f5f5;
    color: #8c8c8c;
}

/* 备份类型标签 */
.log-action-manual {
    background-color: #e6f7ff;
    color: #1890ff;
}

.log-action-auto {
    background-color: #f6ffed;
    color: #52c41a;
}

.log-action-full {
    background-color: #fff7e6;
    color: #fa8c16;
}

.log-action-incremental {
    background-color: #f9f0ff;
    color: #722ed1;
}

/* ========== 备份统计卡片 ========== */
.backup-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.backup-stats .stat-item {
    text-align: center;
    padding: 12px 16px;
    background: var(--bg-light);
    border-radius: var(--border-radius);
}

.backup-stats .stat-label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.backup-stats .stat-value {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-color);
}

/* 状态标签 - 精简 */
.log-table .status-badge {
    padding: 2px 8px;
    font-size: 11px;
    border-radius: 3px;
}

.log-table .btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

/* 日志详情 */
.log-detail {
    padding: 0;
}

.log-detail .detail-row {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}

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

.log-detail .detail-label {
    width: 80px;
    flex-shrink: 0;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 13px;
}

.log-detail .detail-value {
    flex: 1;
    color: var(--text-color);
    font-size: 13px;
}

.log-detail .error-text {
    color: var(--danger-color);
}

.log-detail .detail-json {
    background: var(--bg-light);
    padding: 10px;
    border-radius: var(--border-radius);
    font-size: 12px;
    overflow-x: auto;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-all;
}

/* 分页省略号 */
.pagination-ellipsis {
    padding: 0 6px;
    color: var(--text-secondary);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .log-filter-bar .filter-row {
        flex-direction: column;
    }
    
    .filter-group {
        width: 100%;
        min-width: unset;
    }
    
    .log-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .log-stats .stat-value {
        font-size: 20px;
    }
    
    .log-table .log-description {
        max-width: 120px;
    }
}

/* ==================== 打印样式 ==================== */

/* 打印时的表头（默认隐藏） */
.print-header, .print-footer, .print-thead, .print-tfoot {
    display: none;
}

/* 打印专用容器 - 屏幕隐藏 */
#print-only-container {
    display: none;
    background: white;
}

/* ==================== 打印媒体查询 ==================== */

/* 页面设置 - 必须放在 @media print 外部 */
@page {
    size: A4 portrait;
    margin: 1.5cm 1.2cm 1.8cm 1.2cm;  /* 底部边距稍大，留给页脚 */
}

/* 页脚页码 - 使用 CSS 计数器 */
@page {
    @bottom-center {
        content: "第 " counter(page) " 页";
        font-size: 8pt;
        font-family: "SimSun", "宋体", Arial, sans-serif !important;
        color: #666;
    }
}

/* CSS 变量定义 - 打印时由 JS 设置 */
:root {
    --print-report-title: "财务报表";
    --print-account-set: "";
    --print-period: "";
    --print-date: "";
}

@media print {
    /* 基础设置 - 强制白色背景，消除空白页 */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
        border-radius: 0 !important;
    }
    
    /* 强制白色背景，消除空白页 */
    html, body {
        background: white !important;
        color: #000 !important;
        overflow: visible !important;
        height: auto !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
    }
    
    /* 隐藏所有非打印元素 - 覆盖所有可能的显示 */
    .no-print,
    .filter-form,
    .filter-bar,
    .btn-bar,
    .nav-tabs,
    nav,
    aside,
    .sidebar,
    .sidebar-nav,
    .modal,
    .report-tabs,
    .account-set-selector,
    .header,
    .footer,
    .sidebar-toggle,
    #hideZeroBalanceContainer,
    .toggle-switch,
    .report-filter-bar,
    .report-tabs .tab-btn,
    .sidebar-nav *,
    .top-bar,
    .top-bar *,
    .page-header,
    .page-header-actions,
    #toast,
    .toast,
    .toast-container,
    .menu-toggle,
    .balance-warning,
    #reports-page,
    #modal,
    .sidebar-overlay,
    .print-btn,
    .export-btn,
    .filter-panel,
    .btn,
    button:not(.report-table button),
    .modal-content,
    .main-header,
    .main-sidebar,
    .content-wrapper,
    .main-content,
    .wrapper,
    #app,
    .app-container {
        display: none !important;
        visibility: hidden !important;
        width: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
        background: white !important;
    }
    
    /* 显示打印专用容器 */
    #print-only-container {
        display: block !important;
        visibility: visible !important;
        position: static !important;
        left: auto !important;
        top: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        background: white !important;
        font-family: "SimSun", "宋体", Arial, sans-serif !important;
        font-size: 12px !important;
        line-height: 1.4 !important;
        border: none !important;
    }
    
    /* 隐藏原始报表内容 */
    #reportContent {
        display: none !important;
        visibility: hidden !important;
    }
    
    /* 打印容器内部布局 */
    #print-only-container > * {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }
    
    /* 报表标题（第一页） */
    .print-title-section {
        text-align: center !important;
        margin-bottom: 10px !important;
        padding-bottom: 0 !important;
        border: none !important;
        page-break-after: avoid !important;
        background: white !important;
    }
    
    .print-title-section h1 {
        font-size: 18px !important;
        font-weight: bold !important;
        color: #333 !important;
        margin: 0 0 8px 0 !important;
        background: white !important;
    }
    
    .print-title-section .print-info {
        font-size: 11px !important;
        color: #555 !important;
        line-height: 1.6 !important;
        background: white !important;
    }
    
    .print-title-section .print-info div {
        margin: 2px 0 !important;
    }
    
    /* 报表表格容器 - 使用 100% 适应不同纸张尺寸 */
    .print-table-section {
        margin-top: 10px !important;
        background: white !important;
        width: calc(100% - 2px) !important;
        max-width: calc(100% - 2px) !important;
        overflow-x: visible !important;
    }
    
    /* 表格基础样式 - 字号调大到 12px，使用 border-box */
    .print-table-section table.report-table {
        width: 100% !important;
        max-width: 100% !important;
        border-collapse: collapse !important;
        border: 1px solid #333 !important;
        font-size: 12px !important;
        page-break-inside: auto !important;
        background: white !important;
        box-sizing: border-box !important;
    }
    
    /* 表格表头 - 每页重复 */
    .print-table-section table.report-table thead {
        display: table-header-group !important;
        background-color: #f5f5f5 !important;
    }
    
    .print-table-section table.report-table th {
        background-color: #f5f5f5 !important;
        color: #333 !important;
        font-weight: bold !important;
        text-align: center !important;
        border: 1px solid #333 !important;
        padding: 5px 4px !important;
        font-size: 12px !important;
        page-break-after: avoid !important;
        border-radius: 0 !important;
        box-sizing: border-box !important;
    }
    
    /* 表格表体 */
    .print-table-section table.report-table tbody {
        display: table-row-group !important;
    }
    
    .print-table-section table.report-table td {
        border: 1px solid #333 !important;
        padding: 4px 3px !important;
        font-size: 12px !important;
        text-align: center !important;
        border-radius: 0 !important;
        box-sizing: border-box !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    
    .print-table-section table.report-table td.text-left {
        text-align: left !important;
    }
    
    .print-table-section table.report-table td.text-right {
        text-align: right !important;
    }
    
    /* 分组行样式 */
    .print-table-section table.report-table tbody tr td[colspan] {
        background-color: #e8e8e8 !important;
        font-weight: bold !important;
        text-align: left !important;
    }
    
    /* 汇总行样式 */
    .print-table-section table.report-table tr.total-row,
    .print-table-section table.report-table tbody tr:last-child {
        font-weight: bold !important;
        background-color: #e8e8e8 !important;
    }
    
    /* 行断页控制 */
    .print-table-section table.report-table tbody tr {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }
    
    /* 零余额行隐藏 */
    .zero-balance-row {
        display: none !important;
    }
}