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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary, #2d3748);
    background-color: var(--bg-secondary, #f7fafc);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航栏 */
.navbar {
    background: var(--bg-primary, #ffffff);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    padding: 1rem 0;
    margin-bottom: 0;
    border-bottom: 1px solid var(--border-light, #e2e8f0);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 新增：将logo与左侧主导航包裹为一组，靠左排列 */
.navbar .nav-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* 移动端换行时，保持左侧组自身为行内flex不被拉伸 */
@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        gap: 1rem;
    }
    .navbar .nav-left {
        width: 100%;
        justify-content: flex-start;
    }
}
.navbar .logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.5rem;
    font-weight: 800;
    text-decoration: none;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar .logo span {
    background: linear-gradient(135deg, #c2412d 0%, #a63b25 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar .logo .logo-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.navbar .nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.navbar .nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
    list-style: none;
    margin: 0;
}

.navbar .nav-links li {
    display: flex;
    align-items: center;
}

.navbar .nav-links a {
    text-decoration: none;
    color: var(--text-secondary, #718096);
    padding: 0.75rem 1rem;
    border-radius: 12px;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
}

.navbar .nav-links a:hover {
    background: linear-gradient(135deg, rgba(194, 65, 45, 0.1), rgba(166, 59, 37, 0.1));
    color: var(--primary-color, #c2412d);
    transform: translateY(-1px);
}

/* 导航栏下拉菜单样式 */
.navbar .nav-links .dropdown {
    position: relative;
    height: auto;
}

.navbar .nav-links .dropdown-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-secondary, #718096);
    padding: 0.75rem 1rem;
    border-radius: 12px;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    height: auto;
}

.navbar .nav-links .dropdown-toggle:hover {
    background: linear-gradient(135deg, rgba(194, 65, 45, 0.1), rgba(166, 59, 37, 0.1));
    color: var(--primary-color, #c2412d);
    transform: translateY(-1px);
}

.navbar .nav-links .dropdown-toggle::after {
    content: '';
    margin-left: 0.5rem;
    border-top: 0.3em solid;
    border-right: 0.3em solid transparent;
    border-left: 0.3em solid transparent;
    transition: transform 0.15s ease;
}

.navbar .nav-links .dropdown.show .dropdown-toggle::after {
    transform: rotate(180deg);
}

.navbar .nav-links .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.5rem;
    background: var(--bg-primary, #ffffff);
    border: 1px solid var(--border-light, #e2e8f0);
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    min-width: 180px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0.5rem 0;
    list-style: none;
    margin: 0;
}

.navbar .nav-links .dropdown:hover .dropdown-menu,
.navbar .nav-links .dropdown.show .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.navbar .nav-links .dropdown-item {
    display: block;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text-secondary, #718096);
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 8px;
    margin: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
}

.navbar .nav-links .dropdown-item:hover {
    background: linear-gradient(135deg, rgba(194, 65, 45, 0.1), rgba(166, 59, 37, 0.1));
    color: var(--primary-color, #c2412d);
}

/* 表单样式 */
.form-container {
    max-width: 400px;
    margin: 2rem auto;
    background: var(--bg-primary, #ffffff);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border-light, #e2e8f0);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-light, #e2e8f0);
    border-radius: 12px;
    font-size: 1rem;
    background: var(--bg-primary, #ffffff);
    color: var(--text-primary, #2d3748);
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color, #c2412d);
    box-shadow: 0 0 0 3px rgba(194, 65, 45, 0.1), 0 0 0 1px var(--primary-color, #c2412d);
    transform: translateY(-1px);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.75rem;
    background: linear-gradient(135deg, #c2412d 0%, #a63b25 100%);
    color: #fff;
    text-decoration: none;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(194, 65, 45, 0.3);
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(194, 65, 45, 0.4);
    filter: brightness(1.1);
}

.btn-secondary {
    background: linear-gradient(135deg, #718096, #a0aec0);
    box-shadow: 0 4px 12px rgba(113, 128, 150, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(113, 128, 150, 0.4);
    filter: brightness(1.1);
}

.btn-danger {
    background: linear-gradient(135deg, #f56565, #e53e3e);
    box-shadow: 0 4px 12px rgba(245, 101, 101, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(245, 101, 101, 0.4);
    filter: brightness(1.1);
}


/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    .form-container {
        margin: 1rem;
        padding: 1.5rem;
    }
}

/* 消息提示 */
.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.alert-success {
    background: linear-gradient(135deg, rgba(72, 187, 120, 0.1), rgba(56, 161, 105, 0.1));
    border: 1px solid rgba(72, 187, 120, 0.2);
    color: var(--success-color, #48bb78);
    border-radius: 12px;
}

.alert-error {
    background: linear-gradient(135deg, rgba(245, 101, 101, 0.1), rgba(229, 62, 62, 0.1));
    border: 1px solid rgba(245, 101, 101, 0.2);
    color: #e53e3e;
    border-radius: 12px;
}

.alert-info {
    background: linear-gradient(135deg, rgba(194, 65, 45, 0.1), rgba(166, 59, 37, 0.1));
    border: 1px solid rgba(194, 65, 45, 0.2);
    color: var(--primary-color, #c2412d);
    border-radius: 12px;
}

/* 表单内消息提示 */
.form-message {
    padding: 0.75rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    display: none;
}

.form-message.success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.form-message.error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.form-message.show {
    display: block;
}


/* 公共页面布局样式 */
.main-content-public {
    padding: 2rem 0;
    min-height: calc(100vh - 80px);
}


/* 用户菜单样式 */
.user-menu {
    position: relative;
}

.user-info {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    background: var(--bg-primary, #ffffff);
    border: 1px solid var(--border-light, #e2e8f0);
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.user-info:hover {
    background: linear-gradient(135deg, rgba(194, 65, 45, 0.05), rgba(166, 59, 37, 0.05));
    border-color: var(--primary-color, #c2412d);
    transform: translateY(-1px);
}

.user-name {
    color: var(--text-primary, #2d3748);
    font-weight: 600;
    font-size: 0.875rem;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--bg-primary, #ffffff);
    border: 1px solid var(--border-light, #e2e8f0);
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    min-width: 180px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.user-info:hover .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text-secondary, #718096);
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 8px;
    margin: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.dropdown-item:first-child {
    margin-top: 0.5rem;
}

.dropdown-item:last-child {
    margin-bottom: 0.5rem;
}

.dropdown-item:hover {
    background: linear-gradient(135deg, rgba(194, 65, 45, 0.1), rgba(166, 59, 37, 0.1));
    color: var(--primary-color, #c2412d);
}

.dropdown-item i {
    width: 16px;
    text-align: center;
}

/* 退出登录按钮样式 - 与base.html保持一致 */
.logout-form {
    display: inline;
    width: 100%;
}

.logout-form .dropdown-item {
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    width: 100%;
    font: inherit;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    margin: 0.25rem;
    text-decoration: none;
    color: var(--text-secondary, #718096);
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
}

.logout-form .dropdown-item:hover {
    background: linear-gradient(135deg, rgba(194, 65, 45, 0.1), rgba(166, 59, 37, 0.1));
    color: var(--primary-color, #c2412d);
}

/* 页脚样式 */
.footer {
    background: var(--bg-primary, #ffffff);
    border-top: 1px solid var(--border-light, #e2e8f0);
    margin-top: 4rem;
    padding: 3rem 0 1.5rem;
    color: var(--text-secondary, #718096);
}

.footer .row {
    margin-bottom: 2rem;
}

.footer h4 {
    color: var(--text-primary, #2d3748);
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #c2412d 0%, #a63b25 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer p {
    color: var(--text-secondary, #718096);
    line-height: 1.7;
    font-size: 0.9rem;
}

.footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer ul li {
    margin-bottom: 0.75rem;
}

.footer ul li a {
    color: var(--text-secondary, #718096);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer ul li a:hover {
    color: var(--primary-color, #c2412d);
    transform: translateX(4px);
}

.footer ul li a i {
    width: 16px;
    text-align: center;
}

.footer-bottom {
    border-top: 1px solid var(--border-light, #e2e8f0);
    padding-top: 1.5rem;
}

.footer-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-info p {
    margin: 0;
    color: var(--text-secondary, #718096);
    font-size: 0.875rem;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.footer-links a {
    color: var(--text-secondary, #718096);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.footer-links a:hover {
    color: var(--primary-color, #c2412d);
}

.footer-links span {
    color: var(--border-light, #e2e8f0);
}

/* 响应式页脚 */
@media (max-width: 768px) {
    .footer {
        padding: 2rem 0 1rem;
    }

    .footer .row {
        margin-bottom: 1.5rem;
    }

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

/* 自定义样式 */
.gradient-text {
    background: linear-gradient(135deg, #c2412d 0%, #a63b25 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}