.terms-container {
    max-width: 1400px;
    margin: 0 auto;
}

.terms-header {
    margin-bottom: var(--spacing-2xl);
    text-align: center;
}

.header-content h1 {
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    letter-spacing: -0.02em;
}

.header-content h1 i {
    color: var(--primary-color);
    font-size: 2.5rem;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 1.2rem;
    margin-bottom: var(--spacing-lg);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.last-updated {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    background: rgba(220, 38, 38, 0.1);
    color: var(--primary-color);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.last-updated i {
    font-size: 0.8rem;
}

.terms-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: var(--spacing-2xl);
    align-items: start;
}

.terms-sidebar {
    position: sticky;
    top: 100px;
}

.toc-container {
    background: var(--background-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-md);
    transition: var(--transition-normal);
}

.toc-container:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-lg);
}

.toc-container h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.toc-container h3 i {
    color: var(--primary-color);
    font-size: 1rem;
}

.toc-nav {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-xl);
}

.toc-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    font-size: 0.9rem;
    line-height: 1.4;
    position: relative;
    overflow: hidden;
}

.toc-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: var(--primary-color);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.toc-item:hover,
.toc-item.active {
    background: rgba(220, 38, 38, 0.1);
    color: var(--text-primary);
    transform: translateX(4px);
}

.toc-item:hover::before,
.toc-item.active::before {
    transform: scaleY(1);
}

.toc-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 600;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.toc-item:hover .toc-number,
.toc-item.active .toc-number {
    background: var(--primary-color);
    color: white;
}

.reading-progress {
    border-top: 1px solid var(--border-color);
    padding-top: var(--spacing-lg);
}

.progress-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: var(--spacing-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: var(--spacing-sm);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #b91c1c);
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    font-size: 0.8rem;
    color: var(--primary-color);
    font-weight: 600;
    text-align: center;
}

.terms-content {
    background: var(--background-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--spacing-2xl);
    box-shadow: var(--shadow-md);
    transition: var(--transition-normal);
    position: relative;
}

.terms-content:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-lg);
}

.terms-intro {
    margin-bottom: var(--spacing-2xl);
}

.intro-card {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-lg);
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.1), rgba(220, 38, 38, 0.05));
    border: 1px solid rgba(220, 38, 38, 0.2);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    position: relative;
    overflow: hidden;
}

.intro-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), #b91c1c);
}

.intro-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.intro-text h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.intro-text p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.terms-section {
    margin-bottom: var(--spacing-2xl);
    scroll-margin-top: 120px;
    position: relative;
}

.terms-section:last-of-type {
    margin-bottom: var(--spacing-xl);
}

.terms-section h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid rgba(220, 38, 38, 0.2);
}

.section-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    font-size: 0.9rem;
    font-weight: 700;
    flex-shrink: 0;
}

.section-content {
    color: var(--text-secondary);
    line-height: 1.7;
}

.section-content p {
    margin-bottom: var(--spacing-md);
}

.section-content p:last-child {
    margin-bottom: 0;
}

.terms-list {
    list-style: none;
    margin: var(--spacing-lg) 0;
    padding: 0;
}

.terms-list li {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-md);
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-md);
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
}

.terms-list li:hover {
    background: rgba(255, 255, 255, 0.05);
    border-left-color: var(--primary-color);
    transform: translateX(4px);
}

.terms-list li i {
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.terms-list li i.fa-check-circle {
    color: var(--success-color);
}

.terms-list li i.fa-times-circle,
.terms-list li i.fa-ban {
    color: var(--danger-color);
}

.terms-list li i.fa-bell,
.terms-list li i.fa-lock,
.terms-list li i.fa-globe {
    color: var(--primary-color);
}

.sub-list {
    list-style-type: disc;
    margin-top: var(--spacing-sm);
    margin-left: var(--spacing-lg);
    color: var(--text-muted);
}

.sub-list li {
    background: none;
    border: none;
    padding: var(--spacing-xs) 0;
    transform: none;
}

.sub-list li:hover {
    background: none;
    border-left-color: transparent;
    transform: none;
}

.warning-box,
.disclaimer-box {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    margin: var(--spacing-lg) 0;
    position: relative;
    overflow: hidden;
}

.warning-box {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--warning-color);
}

.warning-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
    background: var(--warning-color);
}

.disclaimer-box {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #60a5fa;
}

.disclaimer-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
    background: #60a5fa;
}

.warning-box i,
.disclaimer-box i {
    font-size: 1.2rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.warning-box div,
.disclaimer-box div {
    flex: 1;
}

.warning-box strong,
.disclaimer-box strong {
    color: inherit;
    font-weight: 600;
    display: block;
    margin-bottom: var(--spacing-xs);
}

.legal-notice {
    margin-top: var(--spacing-2xl);
    border-top: 1px solid var(--border-color);
    padding-top: var(--spacing-xl);
}

.notice-card {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-lg);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05));
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    position: relative;
    overflow: hidden;
}

.notice-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--danger-color), #dc2626);
}

.notice-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: var(--danger-color);
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.notice-content h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    border: none;
    padding: 0;
}

.notice-content p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 16px rgba(220, 38, 38, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    z-index: 1000;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(220, 38, 38, 0.4);
}

.back-to-top:active {
    transform: translateY(0);
}

body.public-page {
    padding-top: 0 !important;
}

.public-navbar {
    position: relative;
    background: rgba(15, 15, 15, 0.95);
    backdrop-filter: blur(24px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: var(--spacing-xl);
}

.public-navbar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(220, 38, 38, 0.3) 30%, 
        rgba(220, 38, 38, 0.6) 50%, 
        rgba(220, 38, 38, 0.3) 70%, 
        transparent 100%
    );
}

.public-navbar .nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 80px;
}

.public-navbar .nav-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease;
}

.public-navbar .nav-brand:hover {
    transform: scale(1.02);
    text-decoration: none;
    color: inherit;
}

.public-navbar .brand-icon {
    width: 44px;
    height: 44px;
}

.public-navbar .brand-icon-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 16px rgba(220, 38, 38, 0.3));
}

.public-navbar .brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.public-navbar .brand-main {
    font-size: 1.5rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.public-navbar .brand-sub {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 2px;
}

.public-navbar .nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.public-footer-section {
    margin-top: var(--spacing-2xl);
}

.cta-section {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.1), rgba(220, 38, 38, 0.05));
    border: 1px solid rgba(220, 38, 38, 0.2);
    border-radius: var(--radius-xl);
    padding: var(--spacing-2xl);
    text-align: center;
    margin-top: var(--spacing-xl);
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), #b91c1c);
}

.cta-section h3 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
}

.cta-section p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xl);
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.cta-buttons .btn {
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 140px;
}

.cta-buttons .btn-primary {
    background: var(--primary-color);
    color: white;
    border: 1px solid var(--primary-color);
}

.cta-buttons .btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(220, 38, 38, 0.3);
    text-decoration: none;
    color: white;
}

.cta-buttons .btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.cta-buttons .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    text-decoration: none;
    color: var(--text-primary);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.terms-content {
    animation: fadeInUp 0.6s ease-out backwards;
}

.terms-sidebar {
    animation: slideInLeft 0.6s ease-out backwards 0.2s;
}

.terms-section {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

.terms-section:nth-child(1) { animation-delay: 0.3s; }
.terms-section:nth-child(2) { animation-delay: 0.4s; }
.terms-section:nth-child(3) { animation-delay: 0.5s; }
.terms-section:nth-child(4) { animation-delay: 0.6s; }
.terms-section:nth-child(5) { animation-delay: 0.7s; }

@media (max-width: 1200px) {
    .terms-container {
        padding: var(--spacing-lg) var(--spacing-md);
    }

    .terms-layout {
        grid-template-columns: 280px 1fr;
        gap: var(--spacing-xl);
    }

    .header-content h1 {
        font-size: 2.5rem;
    }
}

@media (max-width: 1024px) {
    .terms-layout {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    .terms-sidebar {
        position: static;
        order: 2;
    }

    .toc-container {
        background: var(--background-tertiary);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    .terms-content {
        order: 1;
    }

    .header-content h1 {
        font-size: 2.2rem;
    }

    .page-subtitle {
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) {
    .terms-container {
        padding: var(--spacing-md);
    }

    .header-content h1 {
        font-size: 2rem;
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .header-content h1 i {
        font-size: 2rem;
    }

    .page-subtitle {
        font-size: 1rem;
    }

    .terms-content {
        padding: var(--spacing-xl);
    }

    .intro-card {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-md);
    }

    .notice-card {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-md);
    }

    .terms-section h3 {
        font-size: 1.2rem;
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
    }

    .section-number {
        align-self: flex-start;
    }

    .toc-nav {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-xs);
    }

    .toc-item {
        font-size: 0.8rem;
        padding: var(--spacing-sm);
    }

    .toc-number {
        width: 20px;
        height: 20px;
        font-size: 0.7rem;
    }

    .public-navbar .nav-container {
        padding: 0 1rem;
    }
    
    .public-navbar .brand-text {
        display: none;
    }
    
    .public-navbar .brand-icon {
        width: 36px;
        height: 36px;
    }
    
    .cta-section {
        padding: var(--spacing-xl);
    }
    
    .cta-section h3 {
        font-size: 1.5rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .cta-buttons .btn {
        width: 100%;
        max-width: 200px;
    }

    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .terms-container {
        padding: var(--spacing-sm);
    }

    .header-content h1 {
        font-size: 1.8rem;
    }

    .terms-content {
        padding: var(--spacing-lg);
        border-radius: var(--radius-lg);
    }

    .intro-card,
    .notice-card {
        padding: var(--spacing-lg);
    }

    .terms-section h3 {
        font-size: 1.1rem;
    }

    .toc-nav {
        grid-template-columns: 1fr;
    }

    .toc-item {
        justify-content: flex-start;
    }

    .warning-box,
    .disclaimer-box {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-sm);
    }

    .terms-list li {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
    }

    .public-navbar .nav-container {
        padding: 0 0.75rem;
    }
    
    .cta-section {
        padding: var(--spacing-lg);
        margin: var(--spacing-lg) 0;
    }
    
    .cta-section h3 {
        font-size: 1.3rem;
    }
    
    .cta-section p {
        font-size: 1rem;
    }

    .back-to-top {
        bottom: 0.75rem;
        right: 0.75rem;
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .terms-content,
    .terms-sidebar,
    .terms-section {
        animation: none;
        opacity: 1;
    }
}

@media (prefers-contrast: high) {
    .terms-content,
    .toc-container {
        border-width: 2px;
    }

    .intro-card,
    .notice-card,
    .warning-box,
    .disclaimer-box {
        border-width: 2px;
    }

    .toc-item:hover,
    .toc-item.active {
        background: rgba(220, 38, 38, 0.3);
    }
}

.toc-item:focus,
.back-to-top:focus,
.cta-buttons .btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.toc-item:focus-visible,
.back-to-top:focus-visible,
.cta-buttons .btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

@media print {
    .terms-sidebar,
    .back-to-top,
    .public-navbar,
    .cta-section {
        display: none;
    }

    .terms-layout {
        grid-template-columns: 1fr;
    }

    .terms-content {
        box-shadow: none;
        border: 1px solid #000;
        background: white;
        color: black;
    }

    .terms-section h3 {
        page-break-after: avoid;
    }

    .terms-section {
        page-break-inside: avoid;
    }
}