/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f5f5f7;
    color: #1d1d1f;
    line-height: 1.6;
}

/* 顶部标题栏 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0 30px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    backdrop-filter: blur(10px);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.header-title {
    font-size: 1.8rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-right {
    display: flex;
    gap: 15px;
    align-items: center;
}

.header-btn {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 500;
}

.header-btn:hover {
    background: rgba(255,255,255,0.3);
}

.save-btn {
    background: #34c759 !important;
    color: white !important;
}

.save-btn:hover {
    background: #30a46c !important;
    transform: translateY(-1px);
}

.logout-btn {
    background: #ff3b30 !important;
    color: white !important;
}

.logout-btn:hover {
    background: #d70015 !important;
    transform: translateY(-1px);
}

.home-btn {
    background: #4f46e5 !important;
    color: white !important;
}

.home-btn:hover {
    background: #3730a3 !important;
    transform: translateY(-1px);
}

.user-btn {
    background: #0891b2 !important;
    color: white !important;
    position: relative;
}

.user-btn:hover {
    background: #0e7490 !important;
    transform: translateY(-1px);
}

.user-btn::before {
    content: '👤';
    margin-right: 8px;
}

.login-btn {
    background: #7c3aed !important;
    color: white !important;
}

.login-btn:hover {
    background: #5b21b6 !important;
    transform: translateY(-1px);
}

/* 主容器 */
.main-container {
    display: flex;
    margin-top: 80px;
}

/* 侧边栏 */
.sidebar {
    width: 280px;
    background: linear-gradient(180deg, #4a90d9 0%, #357abd 100%);
    border-right: none;
    position: fixed;
    height: calc(100vh - 80px);
    overflow-y: auto;
    box-shadow: 4px 0 20px rgba(0,0,0,0.1);
    border-radius: 0 12px 12px 0;
    scroll-behavior: smooth; /* 添加平滑滚动效果 */
}

.sidebar-content {
    padding: 15px 0;
}

.nav-group {
    margin-bottom: 0;
    border-bottom: 1px solid rgba(255,255,255,0.15);
}

.nav-group:last-child {
    border-bottom: none;
}

.nav-group:first-child .nav-group-header {
    border-radius: 12px 12px 0 0;
}

.nav-group:last-child .nav-group-header {
    border-radius: 0 0 12px 12px;
}

.nav-group-header {
    padding: 18px 25px;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #60a5dd 0%, #4086c4 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    position: relative;
}

.nav-group-header:hover {
    background: linear-gradient(135deg, #75b9ea 0%, #4086c4 100%);
    transform: translateX(3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.nav-header-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-icon {
    font-size: 1.3rem;
    width: 22px;
    text-align: center;
}

.nav-text {
    font-size: 1.05rem;
    letter-spacing: 0.3px;
}

.nav-arrow {
    font-size: 0.9rem;
    transition: transform 0.3s ease;
    color: rgba(255,255,255,0.9);
}

.nav-group-items {
    background: linear-gradient(135deg, #6bb6e6 0%, #4a90d9 100%);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 14px 25px 14px 40px;
    color: rgba(255,255,255,0.95);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    font-size: 1rem;
    position: relative;
}

.nav-item:hover {
    background: linear-gradient(135deg, #80c7f0 0%, #5ba3e0 100%);
    color: white;
    border-left-color: rgba(255,255,255,0.7);
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.nav-item.active {
    background: linear-gradient(135deg, #85d4f5 0%, #60a5dd 100%);
    color: white;
    border-left-color: #fff;
    font-weight: 600;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.1), 0 4px 12px rgba(0,0,0,0.15);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: linear-gradient(180deg, #ffffff 0%, #e3f2fd 100%);
    border-radius: 0 3px 3px 0;
    box-shadow: 0 2px 8px rgba(255,255,255,0.3);
}

.nav-item-dot {
    font-size: 1.2rem;
    margin-right: 10px;
    opacity: 0.8;
}

.nav-item-text {
    flex: 1;
}

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

.sidebar::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 4px;
    border: 2px solid transparent;
    background-clip: content-box;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.5);
    background-clip: content-box;
}

/* 内容区域 */
.content {
    flex: 1;
    margin-left: 280px;
    padding: 35px;
    background: #f5f5f7;
}

.content-body {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 6px 30px rgba(0,0,0,0.06);
    border: 1px solid rgba(0,0,0,0.05);
}

/* 首页样式 */
.welcome-section {
    text-align: center;
    padding: 40px 20px;
}

.welcome-section h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: #1d1d1f;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.feature-card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.action-btn {
    background: #007aff;
    color: white;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 8px;
    margin: 0 10px;
}

/* 其他样式 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #007aff;
    color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.8rem;
}

.btn-outline {
    background: transparent;
    border: 1px solid #007aff;
    color: #007aff;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.data-table th, .data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.data-table th {
    background: #f8f9fa;
}

.flash-message {
    padding: 12px;
    margin: 10px 0;
    border-radius: 4px;
    position: relative;
}

.flash-success {
    background: #d4edda;
    color: #155724;
}

.flash-error {
    background: #f8d7da;
    color: #721c24;
}

.flash-close {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
}

.page-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}

.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.badge-primary {
    background: #007bff;
    color: white;
}

.badge-secondary {
    background: #6c757d;
    color: white;
}

/* 表单样式 */
.form-container {
    max-width: 600px;
    margin: 0 auto;
}

.form-header {
    text-align: center;
    margin-bottom: 30px;
}

.form {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

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

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.required {
    color: #dc3545;
}

.form-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 1rem;
}

.form-input:focus {
    outline: none;
    border-color: #007aff;
}

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

/* 仪表板样式 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.stat-icon {
    font-size: 2.5rem;
}

.stat-content h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-content p {
    color: #86868b;
}

.overview-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.overview-section {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

.status-green { background: #28a745; }
.status-yellow { background: #ffc107; }

.activity-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.activity-time {
    color: #6c757d;
    font-size: 0.9rem;
}

/* 偏好声明页面特定样式 */
.badge-lg {
    font-size: 0.9rem;
    padding: 6px 12px;
}

.badge-outline-secondary {
    background: transparent;
    border: 1px solid #6c757d;
    color: #6c757d;
}

.decision-maker-section {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    background: #f8f9fa;
    height: 100%;
}

.dm-header {
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.statements-display {
    background: white;
    border-radius: 6px;
    padding: 15px;
    min-height: 120px;
    border: 1px solid #e9ecef;
}

.statements-header {
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 8px;
    margin-bottom: 12px;
}

.statement-item {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 4px;
    padding: 8px 12px;
}

.statement-text {
    font-family: monospace;
    font-size: 0.9rem;
    color: #1565c0;
}

.table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.table-hover tbody tr:hover {
    background-color: #f8f9fa;
}

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

.card-header .card-title {
    color: white;
}

/* 添加声明按钮样式 */
.btn-confirm-modern {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(34, 197, 94, 0.2);
    margin-top: 8px;
    min-height: 36px;
}

.btn-confirm-modern:hover {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.btn-confirm-modern:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(34, 197, 94, 0.2);
}

/* input-group-append 容器样式 */
.input-group-append {
    margin-top: 12px;
    display: flex;
    align-items: center;
}

/* 确保与 input-group-modern 的间距 */
.input-group-modern + .input-group-append {
    margin-top: 16px;
}