/*-- 基础重置 --*/
* {
    box-sizing: border-box;
}
html, body, div, span, h1, h2, h3, p, a, ul, li {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 1em;
    font: inherit;
    vertical-align: baseline;
}
body {
    font-family: 'Roboto', sans-serif;
    background-color: #55ACEE;
    width: 100%;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%; /* 防止字体缩放 */
}
ul {
    list-style: none;
}
a {
    text-decoration: none;
    color: #fff;
}

/*-- 主要布局 --*/
.main {
    padding: 1.5em 0.5em 3em; /* 底部增加padding防止误触 */
}
.main-row {
    width: 100%;
    margin: 0 auto;
    background: rgba(0, 0, 0, 0.62);
    border-radius: 8px;
    overflow: hidden;
}
.main-row-info {
    padding: 0.5em;
}

/*-- 属性选择器容器 --*/
.property-md {
    margin: 0 auto;
    width: 100%;
    padding: 0.5em;
    overflow: hidden;
}

/*-- 标题区域 --*/
.property-hd {
    line-height: 1.5;
    background-color: rgba(241, 241, 241, 0.9);
    overflow: hidden;
    padding: 0.8em;
    margin-bottom: 1em;
    border-radius: 8px;
}
.property-hd p {
    color: #333;
    font-size: 1.2em;
    margin: 0;
    font-weight: bold;
    text-align: center;
}

/*-- 按钮样式 --*/
.button {
    background-color: #4CAF50;
    border: none;
    color: white;
    padding: 0.8em 1.2em;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 1em;
    margin: 0.3em;
    cursor: pointer;
    border-radius: 8px;
    min-height: 44px; /* 最小触摸目标尺寸 */
    min-width: 140px;
    flex: 1;
}
.button:hover {
    background-color: #45a049;
}

/*-- 按钮组 --*/
.button-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 1.5em;
    padding: 0 5px;
}

/*-- 学生名单区域 --*/
.property-bd {
    width: 100%;
    clear: both;
    margin-top: 1.5em;
    padding: 0 5px;
}
.property-bd h3 {
    font-size: 1em;
    color: #00CED1;
    margin-bottom: 0.8em;
    font-family: 'Khand', sans-serif;
    font-weight: bold;
    padding-left: 0.5em;
    border-left: 4px solid #00CED1;
}

/* 网格布局 - 桌面端一行5个 */
.property-bd ul {
    display: grid;
    grid-template-columns: repeat(8, 1fr); /* 默认5列 */
    gap: 12px; /* 增加间距防止误触 */
    font-size: 1em;
}

.property-bd li {
    display: flex;
    width: 100%;
}

.property-bd a {
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.8em 0.5em;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: all 0.3s;
    font-size: 0.95em;
    text-align: center;
    min-height: 50px; /* 确保足够触摸高度 默认75px */
    width: 100%;
    word-break: keep-all; /* 保持名字完整 */
    white-space: normal; /* 允许换行 */
    overflow: hidden;
    line-height: 1.3;
    -webkit-tap-highlight-color: rgba(0, 206, 209, 0.3);
}
.property-bd a:hover {
    color: #00CED1;
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/*-- 已选择的学生显示区域 --*/
.property-hd span {
    display: block;
    width: 100%;
    line-height: 1.5;
    padding: 0.5em 0;
}
.property-hd em {
    font-style: normal;
    color: #049;
    font-size: 1em;
    font-weight: bold;
    display: block;
    margin-bottom: 0.5em;
}
.property-hd a.property {
    line-height: 1.5;
    color: #000;
    font-size: 1em;
    display: inline-block;
    background: rgba(76, 175, 80, 0.2);
    padding: 0.5em 0.8em;
    margin: 0.3em;
    border-radius: 6px;
    min-height: 36px;
}
.property-hd a.property:hover {
    color: #C80000;
    background: rgba(76, 175, 80, 0.3);
}

/*-- 复制提示 --*/
.copy-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #4CAF50;
    color: white;
    padding: 0.8em 1.5em;
    border-radius: 6px;
    font-size: 1.2em;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.copy-tip.show {
    opacity: 1;
}

/*========== 响应式设计 ==========*/

/* 平板设备 (768px-1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .main {
        padding: 2em 1em 3em;
    }
    .main-row {
        max-width: 95%;
    }
    
    /* 平板端一行4个 */
    .property-bd ul {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }
    
    .property-bd a {
        font-size: 1em;
        min-height: 65px;
    }
    
    .button {
        padding: 0.9em 1.5em;
        font-size: 1.1em;
    }
    
    .property-bd h3 {
        font-size: 1.5em;
    }
}

/* 大屏幕手机 (480px-767px) */
@media (min-width: 480px) and (max-width: 767px) {
    .property-bd ul {
        grid-template-columns: repeat(3, 1fr); /* 一行3个 */
        gap: 8px;
    }
    
    .property-bd a {
        font-size: 0.9em;
        min-height: 70px;
        padding: 0.7em 0.3em;
    }
    
    .button-group {
        flex-direction: row;
        justify-content: center;
    }
    
    .button {
        min-width: 45%;
        font-size: 0.95em;
    }
}

/* 小屏幕手机 (小于480px) */
@media (max-width: 479px) {
    .main {
        padding: 1em 0.5em 2.5em;
    }
    
    /* 小手机一行2个 */
    .property-bd ul {
        grid-template-columns: repeat(2, 1fr); /* 一行2个 */
        gap: 8px;
    }
    
    .property-bd a {
        font-size: 0.95em;
        min-height: 50px;
        padding: 0.8em 0.3em;
        line-height: 1.4;
    }
    
    .button-group {
       /* flex-direction: column;*/
        gap: 10px;
    }
    
    .button {
        width: 100%;
        min-width: unset;
        font-size: 1em;
        padding: 0.9em;
    }
    
    .property-bd h3 {
        font-size: 1.3em;
    }
    
    .property-hd p {
        font-size: 1.1em;
    }
    
    /* 确保整个页面高度适应 */
    .main-row {
        min-height: calc(100vh - 3em);
    }
}

/* 超大桌面 (大于1400px) */
@media (min-width: 1400px) {
    .main-row {
        max-width: 1300px;
    }
    
    .property-bd ul {
        gap: 15px;
    }
    
    .property-bd a {
        font-size: 1.1em;
        min-height: 70px;
    }
}

/* 超小屏幕手机 (小于360px) */
@media (max-width: 359px) {
    .property-bd ul {
        grid-template-columns: 1fr; /* 单列显示 */
        gap: 6px;
    }
    
    .property-bd a {
        min-height: 60px;
        padding: 0.6em 0.5em;
    }
    
    .property-bd h3 {
        font-size: 1.2em;
    }
    
    .button {
        font-size: 0.95em;
        padding: 0.8em;
    }
}