:root {
    --bg-color: #f4f6f9;
    --card-bg-color: #ffffff;
    --primary-color: #007bff;
    --text-color: #333;
    --text-secondary-color: #6c757d;
    --border-color: #e9ecef;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

footer {
    text-align: center;
    padding: 2rem 0; 
    color: var(--text-secondary-color);
    font-size: 0.9em;
}

footer p {
    margin: 0.3rem 0;
}

footer a {
    text-decoration: none; 
    color: var(--text-secondary-color); 
    transition: color 0.2s ease; 
}

footer a:hover {
    color: var(--primary-color); 
}
.search-section {
    /* margin: 2rem 0; */
    padding: 3rem 0 2rem 0;
}

/* --- 主页特定样式 --- */
.hero-section {
    text-align: center;
    margin: 0rem 0;
}
.hero-section h1 {
    font-size: 2.5em;
    font-weight: 600;
    color: var(--primary-color);
}

.search-section form {
    display: flex;
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    overflow: hidden;
    background-color: var(--card-bg-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.search-input {
    flex-grow: 1;
    border: none;
    padding: 0.8rem 1.2rem;
    font-size: 1em;
    background: transparent;
}
.search-input:focus {
    outline: none;
}
.search-button {
    border: none;
    background-color: var(--primary-color);
    color: white;
    padding: 0 1.5rem;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.2s;
}
.search-button:hover {
    background-color: #0056b3;
}

.shortcuts-section {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.dynamic-section .shortcuts-section,
.miniapp-section .shortcuts-section,
.collapsible-content .shortcuts-section {
    margin-top: 1rem;
}



.combined-shortcuts-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(55px, 1fr));
    gap: 0.5rem;
}

#bookmarks-container,
#recommendations-container {
    display: contents;
}


/* --- 滚动模式 --- */
.combined-shortcuts-wrapper.is-scrolling-mode {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
}

.is-scrolling-mode #bookmarks-container {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 10px;
    margin: 0 -1rem;
    padding: 0 1rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.is-scrolling-mode #bookmarks-container::-webkit-scrollbar { height: 4px; }
.is-scrolling-mode #bookmarks-container::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }

.is-scrolling-mode #bookmarks-container .shortcut-item {
    margin-right: 16px;
    flex-shrink: 0;
}
.is-scrolling-mode #bookmarks-container .shortcut-item span {
    width: 58px;
}

.is-scrolling-mode #recommendations-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(55px, 1fr));
    gap: 0.5rem;
}


.shortcut-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-color);
    padding: 0.2rem;
    border-radius: 8px;
    transition: background-color 0.2s;
}
.shortcut-item:hover {
    background-color: #e9ecef;
}

.shortcut-item img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.shortcut-item span {
    font-size: 0.75em;
    text-align: center; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: clip; 
    width: 100%; 
}

/* --- 访问历史样式 --- */

.history-list {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 2rem;
    position: relative;
}

.history-list::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-0.5px);
    width: 1px;
    background-color: var(--border-color);
}

.history-list .shortcut-item {
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    padding: 0.1rem;
    overflow: hidden;
}

.history-list .shortcut-item:hover {
    background-color: #e9ecef;
}

.history-list .shortcut-item img {
    width: 24px;
    height: 24px;
    margin-bottom: 0;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

.history-list .shortcut-item span {
    font-size: 0.9em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; 
    font-style: clip; 
    text-align: left;
}


.hot-search-section {
    background-color: var(--card-bg-color);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-top: 2rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.hot-search-section h2 {
    margin-top: 0;
    font-size: 1.2em;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}
.hot-search-section ol {
    padding-left: 1.2rem;
    margin: 0;
}
.hot-search-section li {
    padding: 0.4rem 0;
}
.hot-search-section a {
    text-decoration: none;
    color: var(--text-color);
}
.hot-search-section a:hover {
    color: var(--primary-color);
}


.page-header {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}
.back-button {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 500;
    margin-right: 1rem;
}
.page-header h1 {
    margin: 0;
    font-size: 1.8em;
}

.app-card {
    display: flex;
    align-items: center;
    background-color: var(--card-bg-color);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.app-icon {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    margin-right: 1rem;
}
.app-info {
    flex-grow: 1;
}
.app-title {
    margin: 0 0 0.25rem 0;
    font-size: 1.1em;
}
.app-description {
    margin: 0;
    font-size: 0.9em;
    color: var(--text-secondary-color);
}
.app-download-button {
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 15px;
    font-weight: 500;
    font-size: 0.9em;
}
.collapsible-header {
    cursor: pointer; 
    user-select: none; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}


.toggle-arrow {
    transition: transform 0.3s ease;
    font-size: 1em;
    margin-left: 10px;
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
    margin-top: 0;
    padding-top: 0;
    padding-bottom: 0;
    display: none;
}

.collapsible-content.expanded {
    max-height: 1000px; 
    display: block;
}

.collapsible-content.expanded + .collapsible-header .toggle-arrow,
.collapsible-header.active .toggle-arrow {
    /*transform: rotate(90deg); */
}

.police-beian a {
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
}

.police-beian img {
    width: 18px;   
    height: 18px;   
    margin-right: 8px; 
}