.container {
    max-width: 820px;
    padding: 28px 44px;
    font-size: 1.15rem;
    line-height: 1.9;
}

.container h1 {
    font-weight: bold;
    margin-bottom: 1.2rem;
}

.container h2 {
    font-size: 2rem;
    margin-top: 2.2rem;
    margin-bottom: 0.8rem;
}

.container h3 {
    font-size: 1.35rem;
    margin-top: 1.6rem;
    margin-bottom: 0.6rem;
}

.container p {
    margin: 0 0 1.2rem 0;
}

.container ul {
    padding-left: 1.25rem;
    margin: 0 0 1.6rem 0;
}

.container li {
    margin-bottom: 0.75rem;
}

.container hr {
    margin: 2rem 0;
}

.terms-nav {
    margin-bottom: 20px;
}

.terms-nav a {
    display: block;
    margin: 5px 0;
    color: blue;
    text-decoration: none;
    width: fit-content;
}

.terms-nav a:hover {
    text-decoration: underline;
}

.anchor {
    display: block;
    position: relative;
    top: -60px; /* Adjust this value according to your fixed header height */
    visibility: hidden;
}



/* 一般頁面：滾動行為 */
body.tos-page {
    scroll-behavior: smooth;
}

/* 目錄與章節（一般頁面容器作用域） */
.container .toc {
    border: 1px solid #ddd;
    padding: 1rem;
    margin: 1.5rem 0;
}

.container .toc h3 {
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
    font-weight: bold;
}

.container .toc ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.container .toc li {
    margin: 0.3rem 0;
}

.container .toc a {
    color: #333;
    text-decoration: none;
    padding: 0.2rem 0;
    display: block;
}

.container .toc a:hover {
    text-decoration: underline;
}

.container .toc .sub-items {
    padding-left: 1.2rem;
    margin-top: 0.2rem;
}

.container .section {
    margin-bottom: 2rem;
    padding-top: 0.5rem;
    scroll-margin-top: 80px;
}

.container .section h2 {
    border-bottom: 1px solid #ddd;
    padding-bottom: 0.3rem;
    margin-bottom: 1rem;
    position: relative;
}

.container .section h2 .anchor-link {
    margin-left: 0.5rem;
    opacity: 0;
    color: #666;
    text-decoration: none;
    font-size: 0.8em;
}

.container .section h2:hover .anchor-link {
    opacity: 1;
}

.container .section h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
    position: relative;
    scroll-margin-top: 80px;
}

.container .section h3 .anchor-link {
    margin-left: 0.3rem;
    opacity: 0;
    color: #666;
    text-decoration: none;
    font-size: 0.8em;
}

.container .section h3:hover .anchor-link {
    opacity: 1;
}

.container .section ul {
    margin-bottom: 1rem;
}

.container .section li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.container .intro-section {
    border: 1px solid #ddd;
    padding: 1.5rem;
    margin: 1.5rem 0;
    background: #f9f9f9;
}

.container .intro-section p {
    margin-bottom: 0.8rem;
    line-height: 1.6;
}

.container .company-info {
    margin-top: 3rem;
    padding: 1.5rem;
    border: 1px solid #ddd;
    background: #f8f9fa;
    border-radius: 4px;
}

.container .company-info .company-name {
    margin: 0 0 1rem 0;
    font-size: 1.2rem;
    font-weight: bold;
    color: #2c3e50;
    text-align: center;
}

.container .company-info .company-details {
    font-size: 0.95rem;
}

.container .company-info .detail-item {
    margin-bottom: 0.4rem;
    line-height: 1.4;
}

.container .company-info .detail-item:last-child {
    margin-bottom: 0;
}

.container .company-info .label {
    font-weight: 600;
    color: #34495e;
}

.container .company-info a {
    color: #3498db;
    text-decoration: none;
}

.container .company-info a:hover {
    text-decoration: underline;
}

.container .last-updated {
    text-align: center;
    padding: 1rem;
    border-top: 1px solid #ddd;
    margin-top: 2rem;
    color: #666;
    font-size: 0.9rem;
}

/* iframe 專用作用域 */
.tos-iframe {
    margin: 0;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Microsoft JhengHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background: #fff;
    scroll-behavior: smooth;
}

.tos-iframe .terms-content h1 {
    text-align: center;
    margin: 0 0 2rem 0;
    color: #2c3e50;
    font-size: 2rem;
}

.tos-iframe .terms-content .toc {
    border: 1px solid #ddd;
    padding: 1rem;
    margin: 1.5rem 0;
    background: #f8f9fa;
    border-radius: 4px;
}

.tos-iframe .terms-content .toc h3 {
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
    font-weight: bold;
    margin-top: 0;
}

.tos-iframe .terms-content .toc ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.tos-iframe .terms-content .toc li {
    margin: 0.3rem 0;
}

.tos-iframe .terms-content .toc a {
    color: #333;
    text-decoration: none;
    padding: 0.2rem 0;
    display: block;
}

.tos-iframe .terms-content .toc a:hover {
    text-decoration: underline;
}

.tos-iframe .terms-content .toc .sub-items {
    padding-left: 1.2rem;
    margin-top: 0.2rem;
}

.tos-iframe .terms-content .section {
    margin-bottom: 2rem;
    padding-top: 0.5rem;
    scroll-margin-top: 20px;
}

.tos-iframe .terms-content .section h2 {
    border-bottom: 1px solid #ddd;
    padding-bottom: 0.3rem;
    margin-bottom: 1rem;
    position: relative;
    color: #2c3e50;
}

.tos-iframe .terms-content .section h2 .anchor-link {
    margin-left: 0.5rem;
    opacity: 0;
    color: #666;
    text-decoration: none;
    font-size: 0.8em;
}

.tos-iframe .terms-content .section h2:hover .anchor-link {
    opacity: 1;
}

.tos-iframe .terms-content .section h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
    position: relative;
    scroll-margin-top: 20px;
    color: #34495e;
}

.tos-iframe .terms-content .section h3 .anchor-link {
    margin-left: 0.3rem;
    opacity: 0;
    color: #666;
    text-decoration: none;
    font-size: 0.8em;
}

.tos-iframe .terms-content .section h3:hover .anchor-link {
    opacity: 1;
}

.tos-iframe .terms-content .section ul {
    margin-bottom: 1rem;
}

.tos-iframe .terms-content .section li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.tos-iframe .terms-content .intro-section {
    border: 1px solid #ddd;
    padding: 1.5rem;
    margin: 1.5rem 0;
    background: #f9f9f9;
    border-radius: 4px;
}

.tos-iframe .terms-content .intro-section p { margin-bottom: 0.8rem; line-height: 1.6; }
.tos-iframe .terms-content .intro-section p:last-child { margin-bottom: 0; }

.tos-iframe .terms-content .company-info {
    margin-top: 3rem;
    padding: 1.5rem;
    border: 1px solid #ddd;
    background: #f8f9fa;
    border-radius: 4px;
}

.tos-iframe .terms-content .company-info .company-name {
    margin: 0 0 1rem 0;
    font-size: 1.2rem;
    font-weight: bold;
    color: #2c3e50;
    text-align: center;
}

.tos-iframe .terms-content .company-info .company-details {
    font-size: 0.95rem;
}

.tos-iframe .terms-content .company-info .detail-item {
    margin-bottom: 0.4rem;
    line-height: 1.4;
}

.tos-iframe .terms-content .company-info .detail-item:last-child {
    margin-bottom: 0;
}

.tos-iframe .terms-content .company-info .label {
    font-weight: 600;
    color: #34495e;
}

.tos-iframe .terms-content .company-info a {
    color: #3498db;
    text-decoration: none;
}

.tos-iframe .terms-content .company-info a:hover {
    text-decoration: underline;
}

.tos-iframe .terms-content .last-updated {
    text-align: center;
    padding: 1rem;
    border-top: 1px solid #ddd;
    margin-top: 2rem;
    color: #666;
    font-size: 0.9rem;
}

/* 共用：加強重點色 */
.terms-content strong { color: #e74c3c; }

/* 響應式（iframe 用） */
@media (max-width: 768px) {
    .tos-iframe { padding: 15px; }
    .tos-iframe .terms-content h1 { font-size: 1.5rem; }
    .tos-iframe .terms-content .toc { padding: 0.8rem; }
    .tos-iframe .terms-content .intro-section { padding: 1rem; }
}