/* 基础样式 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1500px;
    margin: 0 auto;
    padding: 20px;
}

/* 顶部搜索栏 */
.search-container {
    background-color: #2c3e50;
    padding: 15px 0;
    border-radius: 8px 8px 0 0;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.search-box {
    display: flex;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 15px;
}

.search-box input {
    flex: 1;
    padding: 12px 15px;
    border: none;
    border-radius: 4px 0 0 4px;
    font-size: 16px;
}

.search-box button {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 0 20px;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
}

.search-box button:hover {
    background-color: #c0392b;
}

/* 内容布局 */
.content-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

/* 商标分类横向导航 */
.category-topbar {
    background: white;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    padding: 15px 20px 0 20px;
    margin-bottom: 20px;
}
.category-topbar h2 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #e74c3c;
}
/* 商标分类横向导航li对齐、等宽分布 */
.category-list-horizontal {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
    justify-content: flex-start;
}
.category-list-horizontal li {
    flex: 1 1 120px;
    min-width: 120px;
    text-align: center;
    margin-bottom: 0;
}
.category-list-horizontal a {
    display: block;
    padding: 8px 18px;
    color: #333;
    text-decoration: none;
    border-radius: 4px 4px 0 0;
    background: #f5f7fa;
    transition: all 0.3s;
    font-size: 15px;
    border: 1px solid transparent;
    border-bottom: 2px solid transparent;
}
.category-list-horizontal a:hover {
    background: #f0f0f0;
    color: #e74c3c;
    border-bottom: 2px solid #e74c3c;
}
.category-list-horizontal .active a {
    background: #e74c3c;
    color: #fff;
    border-bottom: 2px solid #c0392b;
}

/* 隐藏原左侧分类栏样式（如有冗余可删除） */
.category-column { display: none; }
.category-list { display: none; }

/* 子分类和项目区域 */
.subclass-section {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.subclass-list {
    flex: 1;
    min-width: 200px;
}

.item-list {
    flex: 2;
    min-width: 300px;
}

.subclass-list ul {
    list-style: none;
}

.subclass-list li {
    margin-bottom: 8px;
}

.subclass-list a {
    display: block;
    padding: 8px 12px;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s;
    font-size: 14px;
}

.subclass-list a:hover {
    background-color: #f0f0f0;
    color: #e74c3c;
}

.subclass-list .active a {
    background-color: #3498db;
    color: white;
}

/* 项目列表 */
.item-list ul {
    list-style: none;
}

/* 项目列表一行显示4个 */
.item-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
}
.item-grid li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    background: #fafbfc;
    border-radius: 4px;
    min-height: 40px;
    justify-content: flex-start;
}

.item-number {
    display: inline-block;
    width: 80px;
    font-family: 'Courier New', monospace;
    color: #7f8c8d;
    font-weight: bold;
}

.item-name {
    flex: 1;
}

.filled-items, .empty-items {
    margin-bottom: 20px;
}

.filled-items h4 {
    color: #27ae60;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 2px solid #27ae60;
}

.empty-items h4 {
    color: #e74c3c;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 2px solid #e74c3c;
}

.welcome-message {
    text-align: center;
    padding: 40px 20px;
}

.welcome-message h2 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.welcome-message p {
    color: #7f8c8d;
    font-size: 18px;
}

.welcome-message img {
    max-width: 100%;
    height: auto;
    margin-top: 20px;
    border-radius: 8px;
}

.no-items {
    text-align: center;
    padding: 40px 0;
    color: #7f8c8d;
}

.breadcrumb {
    font-size: 15px;
    color: #888;
    margin-bottom: 12px;
    padding: 6px 0 6px 0;
    background: none;
}
.breadcrumb span {
    margin-right: 6px;
}

.show-selected-modal-btn {
    position: fixed;
    top: 18px;
    left: 18px;
    z-index: 10000;
    background: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    cursor: pointer;
    transition: background 0.2s;
}
.show-selected-modal-btn:active {
    background: #c0392b;
}
.selected-modal {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 9999;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    padding: 16px 18px 12px 18px;
    min-width: 260px;
    max-width: 350px;
    max-height: 70vh;
    overflow-y: auto;
    border: 1px solid #eee;
    animation: fadeIn 0.2s;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
.selected-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    margin-bottom: 8px;
}
#copy-selected {
    background: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 4px 12px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}
#copy-selected:active {
    background: #c0392b;
}
.selected-group {
    margin-bottom: 10px;
}
.selected-group ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}
.selected-group li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 0;
    font-size: 15px;
}
.selected-group .del-btn {
    background: none;
    color: #aaa;
    border: none;
    border-radius: 3px;
    padding: 2px 8px;
    cursor: pointer;
    font-size: 15px;
    margin-left: 8px;
    transition: color 0.2s;
}
.selected-group .del-btn:hover {
    color: #e74c3c;
}
.selected-group .del-class-btn {
    background: none;
    color: #e74c3c;
    border: none;
    border-radius: 3px;
    padding: 2px 8px;
    cursor: pointer;
    font-size: 16px;
    margin-left: 4px;
    transition: color 0.2s;
}
.selected-group .del-class-btn:hover {
    color: #c0392b;
}
.empty-selected {
    color: #aaa;
    text-align: center;
    padding: 10px 0;
}

.selectable {
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.selectable:hover {
    background: #ffe5e0;
    color: #e74c3c;
    border-radius: 3px;
}

.item-grid li.selectable {
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.item-grid li.selectable:hover {
    background: #ffe5e0;
    color: #e74c3c;
    border-radius: 3px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .content-wrapper {
        flex-direction: column;
    }
    
    .subclass-section {
        flex-direction: column;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .search-box input {
        border-radius: 4px;
        margin-bottom: 5px;
    }
    
    .search-box button {
        border-radius: 4px;
        padding: 12px;
    }
}

@media (max-width: 900px) {
    .item-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 600px) {
    .item-grid {
        grid-template-columns: 1fr;
    }
    .selected-modal {
        left: 50%;
        top: 0;
        transform: translateX(-50%);
        min-width: 90vw;
        max-width: 98vw;
        padding: 10px 6px 8px 6px;
    }
    .show-selected-modal-btn {
        left: 50%;
        top: 8px;
        transform: translateX(-50%);
    }
}